This is an experiment to save state between Ember-CLI addons, using the node-persist package.
This addon simply initializes the storage and assigns it to a property on the global build process
(process.emberAddonStateBucket
).
To save state, simply call:
process.emberAddonStateBucket.setItemSync('key', 'value');
Because node-persist uses JSON to store the data, only valid JSON values can be persisted.
To read out the state, you can call:
process.emberAddonStateBucket.getItemSync('key');
git clone <repository-url>
this repositorycd ember-addon-state-bucket
npm install
Other addons wishing to use this must be configured to run after this one in the ember-addon
config section of their package.json
.
ember serve
- Visit your app at http://localhost:4200.
npm test
(Runsember try:each
to test your addon against multiple Ember versions)ember test
ember test --server
ember build
For more information on using ember-cli, visit https://ember-cli.com/.