@shyamsfo/the-sink
v0.0.53
Published
A kitchen sink of functions for learning npm publish and typescript
Downloads
49
Readme
What is this
Published a hello world module on npm following this:
https://whitep4nth3r.com/blog/how-to-build-test-and-release-node-module-es6
Installation and usage
First run:
yarn add @shyamsfo/the-sink --save
Then, in your js file:
import the_sink from '@shyamsfo/the-sink';
the_sink.now()
the_sink.get_name()
Development Setup
First clone the repo. Then run:
yarn install
Development
- Run
yarn dev
to watch for changes and compile continously yarn clean
to clean resourcesyarn types
to generate typesyarn build
to do a build.yarn test
to run tests
Once development is complete we are ready to publish. See below.
Publish
- First commit all the code using
git add .
andgit commit -m "Commit message"
- Then run
yarn publish
- This will ask for new version number
- package.json will be updated with new version number and a new commit will be done
prepublish
will be run that will do the clean build- package will be published
- git push (including tags) will be done.
- Verify package has been published at https://www.npmjs.com/package/@shyamsfo/the-sink
Setup
How to start a new npm package:
npm init --scope=@shyamsfo
<Development of all code>
npm login
npm publish --access public
Local testing from another node project
# in this directory
yarn link
In the client:
yarn link @shyamsfo/the-sink