This package provides a plugin that reads CSV files used to configure a library or app around a System Dynamics model generated by [SDEverywhere](https://github.com/climateinteractive/SDEverywhere).
npm install @sdeverywhere/plugin-configThis package provides a plugin that reads CSV files used to configure a library or app around a System Dynamics model generated by SDEverywhere.
The best way to get started with SDEverywhere is to follow the Quick Start instructions.
If you follow those instructions, the @sdeverywhere/plugin-config package will be added to your project automatically, in which case you can skip the next section and jump straight to the "Usage" section below.
``shnpm
npm install --save-dev @sdeverywhere/plugin-config
Usage
_Note:_ If you followed the "Quick Start" instructions above, the
create script will have already performed the following steps for you.
Reading these instructions can still be helpful if you are setting up a project manually or want to understand how plugin-config can be integrated into your project.To get started:
1. Copy the included template config files to your local project:
`sh
cd your-model-project
npm install --save-dev @sdeverywhere/plugin-config
cp -rf "./node_modules/@sdeverywhere/plugin-config/template-config" ./config
`2. Replace the placeholder values in the CSV files with values that are suitable for your model.
3. Add a line to your
sde.config.js file that uses the configProcessor function supplied by this package:`js
import { configProcessor } from '@sdeverywhere/plugin-config'export async function config() {
return {
// Specify the Vensim model to read
modelFiles: ['example.mdl'],
// Read csv files from
config directory and write to the recommended output
// directory structure. See ConfigProcessorOptions for more details.
modelSpec: configProcessor({
config: 'config'
}), plugins: [
// ...
]
}
}
`4. Run
sde bundle or sde dev; your config files will be used to drive the build process.Documentation
API documentation (for plugin configuration options) is available in the
docs directory.License
SDEverywhere is distributed under the MIT license. See
LICENSE` for more details.