2.0.1 • Published 7 years ago
scontainers-demo v2.0.1
scontainers-demo
A minimal demo for scontainers. It shows how to properly set up a project using scontainers.
The program shows different syntax in action:
- Straits syntax, compiled with babel6 (also see the babel7 version)
- Traits as member symbols
- Traits as free functions
Installation and execution
If you wish to clone the repository, after cloning it you can run:
npm install # install all the dependencies (including dev ones) and build the code
npm start # run the program
node dist/index.js # run the code directly
npx babel-node src/index.js # run the source code directly, transpiling it on the flyIn order to install the package from npm, you can run:
npm install -g "scontainers-demo@babel6" # install the package globally
scontainers-demo # run the program
npm uninstall -g scontainers-demo # uninstall the packageBest practices
When developing something using scontainers (or straits in general), remember to:
- Include in your
package.jsonapreparescript that builds the app (e.g. transpiles the straits syntax into standard JavaScript). This script is called at the end ofnpm installand before publishing withnpm publish. - Set up a
.npmignorefile to avoid publishing on the npm registry source files, tests etc. End users will only need the processed scripts and possibly a readme.