scontainers-demo
v2.0.1
Published
A demo for scontainers
Downloads
6
Readme
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 fly
In 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 package
Best practices
When developing something using scontainers (or straits in general), remember to:
- Include in your
package.json
aprepare
script that builds the app (e.g. transpiles the straits syntax into standard JavaScript). This script is called at the end ofnpm install
and before publishing withnpm publish
. - Set up a
.npmignore
file to avoid publishing on the npm registry source files, tests etc. End users will only need the processed scripts and possibly a readme.