The repository dummy_calcul is for learning and experimenting a TS-written NPM package for use in Node-JS or Browser. It is inspired by this blog-post
The goal of this library is to learn publishing a npm-package for nodejs and browser.
In a bash-terminal:
mkdir test
cd test
npm i dummy-calcul
In a nodejs-script:
const dummyCalcul = require("dummy-calcul");
let result = dummyCalcul.add1000(9);
console.log(result);
In a bash-terminal:
mkdir test
cd test
npm i dummy-calcul typescript
In a ts-script, called abc.ts:
import { add1000, mult1000 } from "dummy-calcul";
console.log(add1000(5));
console.log(mult1000(7));
In a bash-terminal:
npx tsc abc.ts
node abc.js
In your html-file:
<script src="https://unpkg.com/dummy-calcul@1.2.0/dist/dummy-calcul.min.js"></script>
In a bash-terminal:
mkdir test
cd test
npm i dummy-calcul
npx dummy-calcul-cli add1000 -n 7
npx dummy-calcul-cli mult1000 -n 8
In a bash-terminal:
git commit -am "some updates"
npm version minor
git push
npm publish