|
1 | | -# @ember/string |
| 1 | +@ember/string |
| 2 | +============================================================================== |
2 | 3 |
|
3 | | -This Ember addon contains utility functions to deal with `String`s. |
| 4 | +[Short description of the addon.] |
4 | 5 |
|
5 | | -## Installation |
| 6 | +Installation |
| 7 | +------------------------------------------------------------------------------ |
6 | 8 |
|
7 | | -* `ember install @ember/string` |
| 9 | +``` |
| 10 | +ember install my-addon |
| 11 | +``` |
8 | 12 |
|
9 | | -## Usage |
10 | 13 |
|
11 | | -The following exports are available: |
| 14 | +Usage |
| 15 | +------------------------------------------------------------------------------ |
12 | 16 |
|
13 | | -```javascript |
14 | | -import { |
15 | | - camelize, |
16 | | - capitalize, |
17 | | - classify, |
18 | | - dasherize, |
19 | | - decamelize, |
20 | | - underscore, |
21 | | - w, |
22 | | - fmt, |
23 | | - loc |
24 | | -} from '@ember/string'; |
25 | | -``` |
| 17 | +[Longer description of how to use the addon in apps.] |
26 | 18 |
|
27 | | -### `camelize`, `capitalize`, `classify`, `dasherize`, `decamelize`, `underscore` |
28 | 19 |
|
29 | | -These methods transform a string, for example: |
| 20 | +Contributing |
| 21 | +------------------------------------------------------------------------------ |
30 | 22 |
|
31 | | -```javascript |
32 | | -import { camelize } from '@ember/string'; |
| 23 | +### Installation |
33 | 24 |
|
34 | | -camelize("my class") // MyClass |
35 | | -``` |
| 25 | +* `git clone <repository-url>` |
| 26 | +* `cd my-addon` |
| 27 | +* `npm install` |
36 | 28 |
|
37 | | -Consult the tests of the respective function to see the behaviour in more detail. |
| 29 | +### Linting |
38 | 30 |
|
39 | | -### `w` |
| 31 | +* `npm run lint:hbs` |
| 32 | +* `npm run lint:js` |
| 33 | +* `npm run lint:js -- --fix` |
40 | 34 |
|
41 | | -This utility function takes a string, splits it on spaces, and returns an array with the elements. |
| 35 | +### Running tests |
42 | 36 |
|
43 | | -```javascript |
44 | | -import { w } from '@ember/string'; |
| 37 | +* `ember test` – Runs the test suite on the current Ember version |
| 38 | +* `ember test --server` – Runs the test suite in "watch mode" |
| 39 | +* `ember try:each` – Runs the test suite against multiple Ember versions |
45 | 40 |
|
46 | | -w("my array of strings") // ["my", "array", "of", "strings"] |
47 | | -``` |
| 41 | +### Running the dummy application |
| 42 | + |
| 43 | +* `ember serve` |
| 44 | +* Visit the dummy application at [http://localhost:4200](http://localhost:4200). |
| 45 | + |
| 46 | +For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). |
48 | 47 |
|
49 | | -### `fmt`, `loc` |
| 48 | +License |
| 49 | +------------------------------------------------------------------------------ |
50 | 50 |
|
51 | | -These methods are deprecated and only included to ease the transition from the `Ember.String` namespace. |
52 | | -See [DEPRECATIONS.md](DEPRECATIONS.md) for more details on how to resolve the deprecations. |
| 51 | +This project is licensed under the [MIT License](LICENSE.md). |
0 commit comments