Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
generator-ts-np
Advanced tools
Yeoman Generator For Building Node Packages With Typescript.
:warning: This package is in Beta. You are warned!
This package helps you to scaffold a directory skeleton required to start writing an npm package in Typescript, which is fully configured and ready to contain your module logic. And finally, ready to publish.
Here you writes your logic in Typescript and publish the compiled version of it - easily.
es5
. (which means the code runs in many versions of node)npm install -g generator-ts-np
yo ts-np
Here is what you get:
.
|-- media
| `-- cong.jpg
|-- package.json
|-- README.md
|-- src
| `-- index.ts
|-- tests
| `-- index.spec.ts
|-- tsconfig.json
|-- tslint.json
|-- typings
| |-- lme.d.ts
| `-- typings.d.ts
|-- .gitignore
|-- .npmignore
|-- .travis.yml
|-- .vscode
`-- .yo-rc.json
npm build
, a dist/
folder will also be created with all your compiled code.media/
: All your gallery.src/
: All your source code.typings/
: All your type definitionstests/
: All your tests. Mocha looks at this directory.Special Notes
credentials/
at the root of your package, which will be ignored by both git and npm.npm publish
, mainly the content of dist/
will be published. To know what folders/files will be ignored, take a look at .npmignore
.:warning: Important: Before publishing your package, hand check each and every file and verify everything is perfect.
ts-np
only helps you to get started quickly and step back it self leaving the rest to you.
To know really what happens under the hood, refer scripts
section in package.json
at your package root.
npm run build
: compiles content of src/
into dist/
foldernpm run build-watch
: invokes npm run build
under watch
mode => means, it looks for file changes and if any, re-builds.npm run lint
: lints and styles your code with prettier and tslint and fixes fixable issues.npm run lint-noFix
: invokes npm lint
without fix option => means if any issues found, it just notifies with out fixing it.npm test
or npm run test
: runs your tests in tests/
directory in TypeScript execution environment after temporarily setting env-var NODE_ENV
to test
.npm run test-watch
: invokes npm test
but in watch
mode => means, if any file changes, it automatically re-run tests.npm run lint-noFix
. i.e., while you git commit
your changes, it runs npm run lint-noFix
to confirm that there are no issues with linting. If any issues found, it notifies and abort the commit.--no-verify
.If you found any issues, kindly report at github issues.
MIT © Vajahath Ahmed
FAQs
Yeoman Generator For Building Node Packages With Typescript
The npm package generator-ts-np receives a total of 3 weekly downloads. As such, generator-ts-np popularity was classified as not popular.
We found that generator-ts-np demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.