New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

generator-jsmodule

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-jsmodule

Generator for scaffolding out a JavaScript module for Node.js or the browser

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

JavaScript module generator

Build Status

A Yeoman generator for JavaScript modules.

Installation

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.

Generators

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.

jsmodule:app

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

jsmodule:browser

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

Running your module's tests

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.

Keywords

FAQs

Package last updated on 25 Aug 2013

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc