
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
generator-jsmodule
Advanced tools
Generator for scaffolding out a JavaScript module for Node.js or the browser
A Yeoman generator for JavaScript modules.
Install Node.js (which comes with npm).
Then globally install the generator.
npm install -g generator-jsmodule
Make a new directory, and cd
into it:
mkdir mymodule && cd $_
Now scaffold out a JS module using the yo
command (and optionally passing a
name for your module):
yo jsmodule <module-name>
All your dependencies will automatically be installed unless you include the
--skip-install
option.
Available generators (to be run in the root directory).
jsmodule <module-name>
(aka jsmodule:app
)jsmodule:browser <module-name>
N.B. You should replace the placeholder GitHub username in the Travis CI build-status paths at the top of the generated README.
Generates the boilerplate you need for a simple Node.js module.
Example:
yo jsmodule mymodule
Produces:
.
āāā node_modules
ā āāā chai
ā āāā mocha
āāā test
ā āāā test.js
āāā .gitignore
āāā .jshintrc
āāā .travis.yml
āāā CHANGELOG.md
āāā LICENSE.md
āāā README.md
āāā mymodule.js
āāā package.json
Generates the boilerplate you need for a simple client-side JavaScript module.
It setups the Karma test runner to run unit tests in the browser. Unit tests rely on the Mocha test framework and the Chai assertion library.
Example:
yo jsmodule:browser mymodule
Produces:
.
āāā bower_components
ā āāā chai
āāā node_modules
ā āāā karma
āāā test
ā āāā test.js
āāā .gitignore
āāā .jshintrc
āāā .travis.yml
āāā CHANGELOG.md
āāā LICENSE.md
āāā README.md
āāā bower.json
āāā karma.conf.js
āāā mymodule.js
āāā package.json
The client-side JS package uses a local installation of Karma to run the unit tests. You can easily autowatch your tests during development:
karma start
Or run the unit tests in CI with:
npm test
For further information about configuring Karma, please refer to the Karma website.
FAQs
Generator for scaffolding out a JavaScript module for Node.js or the browser
The npm package generator-jsmodule receives a total of 4 weekly downloads. As such, generator-jsmodule popularity was classified as not popular.
We found that generator-jsmodule 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.