主要功能: - 修改RequirementModal支持12个订单班选择 - 添加OrderClassIconMap图标映射组件 - Store中添加selectedOrderClass状态管理 - WorkflowPage支持传递orderClass参数 - web_result添加URL参数切换功能 - 创建order-class-handler.js动态处理页面主题 技术改进: - 创建软链接关联订单班数据目录 - 生成wenlu.json和food.json数据结构 - 删除重复的web_result目录 - 添加测试页面test-order-class.html 影响范围: - 展会策划系统现支持12个订单班 - 结果展示页面自动适配不同订单班主题 - 用户可选择不同行业生成对应方案 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
201 lines
6.2 KiB
Markdown
201 lines
6.2 KiB
Markdown
# word-wrap [](https://www.npmjs.com/package/word-wrap) [](https://npmjs.org/package/word-wrap) [](https://npmjs.org/package/word-wrap) [](https://travis-ci.org/jonschlinkert/word-wrap)
|
|
|
|
> Wrap words to a specified length.
|
|
|
|
Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.
|
|
|
|
## Install
|
|
|
|
Install with [npm](https://www.npmjs.com/):
|
|
|
|
```sh
|
|
$ npm install --save word-wrap
|
|
```
|
|
|
|
## Usage
|
|
|
|
```js
|
|
var wrap = require('word-wrap');
|
|
|
|
wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
|
|
```
|
|
|
|
Results in:
|
|
|
|
```
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing
|
|
elit, sed do eiusmod tempor incididunt ut labore
|
|
et dolore magna aliqua. Ut enim ad minim veniam,
|
|
quis nostrud exercitation ullamco laboris nisi ut
|
|
aliquip ex ea commodo consequat.
|
|
```
|
|
|
|
## Options
|
|
|
|

|
|
|
|
### options.width
|
|
|
|
Type: `Number`
|
|
|
|
Default: `50`
|
|
|
|
The width of the text before wrapping to a new line.
|
|
|
|
**Example:**
|
|
|
|
```js
|
|
wrap(str, {width: 60});
|
|
```
|
|
|
|
### options.indent
|
|
|
|
Type: `String`
|
|
|
|
Default: `` (two spaces)
|
|
|
|
The string to use at the beginning of each line.
|
|
|
|
**Example:**
|
|
|
|
```js
|
|
wrap(str, {indent: ' '});
|
|
```
|
|
|
|
### options.newline
|
|
|
|
Type: `String`
|
|
|
|
Default: `\n`
|
|
|
|
The string to use at the end of each line.
|
|
|
|
**Example:**
|
|
|
|
```js
|
|
wrap(str, {newline: '\n\n'});
|
|
```
|
|
|
|
### options.escape
|
|
|
|
Type: `function`
|
|
|
|
Default: `function(str){return str;}`
|
|
|
|
An escape function to run on each line after splitting them.
|
|
|
|
**Example:**
|
|
|
|
```js
|
|
var xmlescape = require('xml-escape');
|
|
wrap(str, {
|
|
escape: function(string){
|
|
return xmlescape(string);
|
|
}
|
|
});
|
|
```
|
|
|
|
### options.trim
|
|
|
|
Type: `Boolean`
|
|
|
|
Default: `false`
|
|
|
|
Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line.
|
|
|
|
**Example:**
|
|
|
|
```js
|
|
wrap(str, {trim: true});
|
|
```
|
|
|
|
### options.cut
|
|
|
|
Type: `Boolean`
|
|
|
|
Default: `false`
|
|
|
|
Break a word between any two letters when the word is longer than the specified width.
|
|
|
|
**Example:**
|
|
|
|
```js
|
|
wrap(str, {cut: true});
|
|
```
|
|
|
|
## About
|
|
|
|
<details>
|
|
<summary><strong>Contributing</strong></summary>
|
|
|
|
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>Running Tests</strong></summary>
|
|
|
|
Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:
|
|
|
|
```sh
|
|
$ npm install && npm test
|
|
```
|
|
|
|
</details>
|
|
|
|
<details>
|
|
<summary><strong>Building docs</strong></summary>
|
|
|
|
_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_
|
|
|
|
To generate the readme, run the following command:
|
|
|
|
```sh
|
|
$ npm install -g verbose/verb#dev verb-generate-readme && verb
|
|
```
|
|
|
|
</details>
|
|
|
|
### Related projects
|
|
|
|
You might also be interested in these projects:
|
|
|
|
* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.")
|
|
* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.")
|
|
* [unique-words](https://www.npmjs.com/package/unique-words): Returns an array of unique words, or the number of occurrences of each word in… [more](https://github.com/jonschlinkert/unique-words) | [homepage](https://github.com/jonschlinkert/unique-words "Returns an array of unique words, or the number of occurrences of each word in a string or list.")
|
|
* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.")
|
|
|
|
### Contributors
|
|
|
|
| **Commits** | **Contributor** |
|
|
| --- | --- |
|
|
| 47 | [jonschlinkert](https://github.com/jonschlinkert) |
|
|
| 7 | [OlafConijn](https://github.com/OlafConijn) |
|
|
| 3 | [doowb](https://github.com/doowb) |
|
|
| 2 | [aashutoshrathi](https://github.com/aashutoshrathi) |
|
|
| 2 | [lordvlad](https://github.com/lordvlad) |
|
|
| 2 | [hildjj](https://github.com/hildjj) |
|
|
| 1 | [danilosampaio](https://github.com/danilosampaio) |
|
|
| 1 | [2fd](https://github.com/2fd) |
|
|
| 1 | [leonard-thieu](https://github.com/leonard-thieu) |
|
|
| 1 | [mohd-akram](https://github.com/mohd-akram) |
|
|
| 1 | [toddself](https://github.com/toddself) |
|
|
| 1 | [wolfgang42](https://github.com/wolfgang42) |
|
|
| 1 | [zachhale](https://github.com/zachhale) |
|
|
|
|
### Author
|
|
|
|
**Jon Schlinkert**
|
|
|
|
* [GitHub Profile](https://github.com/jonschlinkert)
|
|
* [Twitter Profile](https://twitter.com/jonschlinkert)
|
|
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
|
|
|
|
### License
|
|
|
|
Copyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert).
|
|
Released under the [MIT License](LICENSE).
|
|
|
|
***
|
|
|
|
_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 22, 2023._ |