geenee-spell
Version:
regenerates project code based upon settings and a template
75 lines (40 loc) • 2.11 kB
Markdown
[//]: # ( ns__file unit: standard, comp: README.md )
[//]: # ( ns__custom_start beginning )

[//]: # ( ns__custom_end beginning )
[//]: # ( ns__start_section intro )
[//]: # ( ns__custom_start description )
regenerates code in a project based upon a template and a settings file.
[//]: # ( ns__custom_end description )
[//]: # ( ns__custom_start afterDescription )
[//]: # ( ns__custom_end afterDescription )
[//]: # ( ns__custom_start badges )
[//]: # ( ns__start_section usageSection )
[](https://codecov.io/gh/YizYah/geenee-spell)
[](https://npmjs.org/package/geenee-spell)
[](https://npmjs.org/package/geenee-spell)
[](https://github.com/YizYah/geenee-spell/blob/master/package.json)
A [geenee](https://www.npmjs.com/package/geenee) code base contains a `meta` directory, which should have a `template` and a settings file called `ns.yml`. This package exposes a single async function that can regenerate the whole code base from scratch when your template and/or settings have changed.
You probably won't need to use this package directly. It gets included by geenee and [copykat](https://www.npmjs.com/package/copykat).
[//]: # ( ns__custom_end badges )
[//]: # ( ns__end_section intro )
[//]: # ( ns__start_section api )
[//]: # ( ns__custom_start APIIntro )
# Usage
Install
```
npm i geenee-spell
```
Then you can generate code by specifying a package. The simplest usage is like this:
```
const generateCode = require('geenee-spell')
(async () => {
await generateCode('~/packages/myPackage', {}, null)
})();
```
[//]: # ( ns__custom_end APIIntro )
[//]: # ( ns__custom_start constantsIntro )
[//]: # ( ns__custom_end constantsIntro )
[//]: # ( ns__start_section types )
[//]: # ( ns__end_section types )
[//]: # ( ns__end_section api )