THIS LIBRARY STILL IN EARLY DEVELOPMENT, IT'S NOT STABLE, AND USAGE IN PRODUCTION IS NOT RECOMMENDED YET.
$ npm install @alfonsofilho/specjs --save
$ yarn add @alfonsofilho/specjs
Then import/require the module.
const SpecJS = ;// or;
Place the snippet into your html:
This file is a bundle in the UMD format. In the browser's environments, the module name is in available in
See more in examples.
Most basic usage:
;// 1. Write the Contract// 2. Write the function or class// 3. Bind the implementation and the contract// 4. Use the signed function with the runtime// guarantees provided by the contracttoUpperSigned'test' === 'TEST' // OKtoUpperSigner'' === 'TEST' // Precondition fails
There are many interesting projects out there implementing design by contract. Search more in NPM.
Learn more about design by contract
- Improving or correcting the documentation.
- Finding bugs
- Sharing this project.
- PRs are very welcome.
This project is licensed under the MIT License - see the LICENSE file for details.
See CHANGELOG file for details.