Research
Security News
Malicious PyPI Package ‘pycord-self’ Targets Discord Developers with Token Theft and Backdoor Exploit
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
generator-my-node
Advanced tools
generator-node
creates a base template to start a new Node.js module.
It is also easily composed into your own generators so you can only target your efforts at your generator's specific features.
$ npm install --global generator-node
$ yo node
Note that this template will generate files in the current directory, so be sure to change to a new directory first if you don't want to overwrite existing files.
That'll generate a project with all the common tools setup. This includes:
package.json
fileOnce the project is scaffolded, inside the project folder run:
$ npm test
You can also directly use jest to run test on single files:
$ npm -g install jest-cli
$ jest --watch
Once your tests are passing (ideally with a Travis CI green run), you might be ready to publish your code to npm. We recommend you using npm version to tag release correctly.
$ npm version major
$ git push --follow-tags
# ATTENTION: There is no turning back here.
$ npm publish
First of all, make sure you're comfortable with Yeoman composability feature. Then in your own generator:
var Generator = require('yeoman-generator');
module.exports = class extends Generator({
default() {
this.composeWith(require.resolve('generator-node/generators/app'), {
/* provide the options you want */
});
}
});
Here's a list of our supported options:
boilerplate
(Boolean, default true) include or not the boilerplate files (lib/index.js
, test/index.js
).cli
(Boolean, default false) include or not a lib/cli.js
file.editorconfig
(Boolean, default true) include or not a .editorconfig
file.git
(Boolean, default true) include or not the git files (.gitattributes
, .gitignore
).license
(Boolean, default true) include or not a LICENSE
file.travis
(Boolean, default true) include or not a .travis.yml
file.githubAccount
(String) Account name for GitHub repo location.readme
(String) content of the README.md
file. Given this option, generator-node will still generate the title (with badges) and the license section.If you don't need all the features provided by the main generator, you can still use a limited set of features by composing with our sub generators directly.
Remember you can see the options of each sub generators by running yo node:sub --help
.
node:boilerplate
node:cli
node:editorconfig
node:eslint
node:git
node:nsp
node:readme
Love Yeoman work and community? Help us keep it alive by donating funds to cover project expenses!
[Become a backer]
MIT © Yeoman team (http://yeoman.io)
FAQs
Create a Node.js module
We found that generator-my-node 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.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.
Security News
Snyk's use of malicious npm packages for research raises ethical concerns, highlighting risks in public deployment, data exfiltration, and unauthorized testing.