Skip to content

Commit 79deacc

Browse files
committed
Update README
1 parent 03e0735 commit 79deacc

File tree

1 file changed

+29
-4
lines changed

1 file changed

+29
-4
lines changed

README.md

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ generateTemplateFiles([
4646
output: {
4747
path: './src/stores/__store__(lowerCase)',
4848
pathAndFileNameDefaultCase: '(kebabCase)',
49+
overwrite: true,
4950
},
5051
},
5152
{
@@ -228,23 +229,47 @@ One Rule: no spaces between the [Replacer Slots](#replacer-slots-or-ireplacerslo
228229

229230
You can use `generate-template-files` with the command line to generate your template files.
230231

232+
```js
233+
// generate.js
234+
const {generateTemplateFilesCommandLine} = require('generate-template-files');
235+
236+
generateTemplateFilesCommandLine([
237+
{
238+
option: 'Create Reduce Action',
239+
defaultCase: '(pascalCase)',
240+
entry: {
241+
folderPath: './tools/templates/react/redux-store/__store__Action.ts',
242+
},
243+
stringReplacers: ['__store__', '__model__'],
244+
dynamicReplacers: [
245+
{slot: '__version__', slotValue: config.version},
246+
{slot: '__description__', slotValue: config.description},
247+
],
248+
output: {
249+
path: './src/stores/__store__/__store__(lowerCase)/__store__(pascalCase)Action.ts',
250+
pathAndFileNameDefaultCase: '(kebabCase)',
251+
},
252+
},
253+
]);
254+
```
255+
231256
###### Minimum Options
232257

233258
```txt
234-
node ./tools/generate.js angular-ngrx-store __name__=some-name
259+
node ./tools/generate.js create-reduce-action __store__=some-name __model__=some-other-name
235260
```
236261

237262
###### All Options
238263

239264
```txt
240-
node ./tools/generate.js angular-ngrx-store __name__=some-name __model__=some-other-name --outputpath=./src/here --overwrite
265+
node ./tools/generate.js create-reduce-action __store__=some-name __model__=some-other-name --outputpath=./src/here --overwrite
241266
```
242267

243268
**Command LIne Script Overview**
244269

245270
- `node ./tools/generate.js` - Runs the `generate-template-files` library
246-
- `angular-ngrx-store` - The template name; It uses the same option name in the [IConfigItem](#iconfigitem) but converts all options names to kebab-case. For example `option: 'Angular Ngrx Store'` will be converted to `angular-ngrx-store` when using the command line
247-
- `__name__=some-name` - Are [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) and will be converted to `{ slot: "__name__", slotValue: "some-name" }`
271+
- `create-reduce-action` - The template name; It uses the same option name in the [IConfigItem](#iconfigitem) but converts all options names to kebab-case. For example `option: 'Create Reduce Action'` will be converted to `create-reduce-action` when using the command line
272+
- `__store__=some-name` - Are [Replacer Slots](#replacer-slots-or-ireplacerslotquestion) and will be converted to `{ slot: "__store__", slotValue: "some-name" }`
248273
- `--outputpath=./src/here` - Will override the `output.path` in the [IConfigItem](#iconfigitem)
249274
- `--overwrite` - Will overwrite files if the files already exists
250275

0 commit comments

Comments
 (0)