Module using TS
lower()
const { lower } = require("heyveryouaire/string_and_more")
lower("string")
upper()
const { upper } = require("heyveryouaire/string_and_more")
upper("string")
getPersonGender()
const { getPersonGender } = require("heyveryouaire/string_and_more")
getPersonGender({
name: "name",
sex: "male"
})
How TS module works
tscongif.json
{
"compilerOptions": {
"target": "es2016",
"module": "commonjs",
"declaration": true,
"outDir": "lib",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true,
"exclude": ["node_modules"]
}
}
package.json
{
"main": "lib/index.js",
"types": "lib/index.d.js",
"scripts": {
"build": "tsc"
},
}
Publish npm module
npm login
...
npm publish --access public
...
npm version 1.1.0 // update version between each publish
...