0.2.0 • Published 11 years ago

generator-jsmodule v0.2.0

Weekly downloads
5
License
-
Repository
github
Last release
11 years ago

JavaScript module generator

Build Status

A JavaScript module generator for Yeoman.

Installation

Install Node.js (which comes with npm).

Then globally install Bower, Yo, and this generator.

npm install -g bower yo 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:

.
├── 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

Run npm test to trigger the tests.

The client-side JS module uses a local installation of Karma. If you install Karma globally, then this is an easy way to automatch your tests during development:

karma start

For further information about configuring Karma, please refer to the Karma website.

0.2.0

11 years ago

0.1.5

11 years ago

0.1.4

11 years ago

0.1.3

11 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

11 years ago