Socket
Book a DemoInstallSign in
Socket

generator-umd

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-umd

An Yeoman Generator to create a basic UMD structure

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

generator-umd

version: 0.1.0

Build Status

An Yeoman Generator to create a basic UMD (Universal Module Definition) structure.

Getting Started

About

This script is an Yeoman Generator, meant to be used with some modern Javascript tools such as npm and Bower.

Information on the generated module

  • The generated module will use the returnExportsGlobal definition from UMD.

  • It will provide support to both AMD(RequireJS), Node.js, Browserify and global namespace definition.

  • File definition for both npm and Bower package managers will be also generated along with the initial structure.

  • A simple Mocha test suit will be available with some dummy tests.

Setup

You will need to have at least npm previously installed on your machine.

npm install -g yo
  • Install the UMD Generator
npm install -g generator-umd

Generating your module

  • Open your terminal, navigate to an empty folder destined to your module:
mkdir new-module
cd new-module/
  • Run the generator:
yo umd
  • Input the required information, the generator will ask you:
  • A module name
  • A description to your module (optional)
  • The repository URL for your module (optional)
  • You should be ready to go!
  • Tests can be run using npm test command.
  • Please do not remove the comments metadata from the generated js file, see reasoning below.

Todo

Support a way of easily adding dependencies

If you need to consume other libraries from inside your module, you will have to take a look at the UMD spec and implement it by yourself.

I have plans to add this feature in a subgenerator, using the comment metadata from the generated module file.

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality.

License

Released under the MIT License.

Keywords

yeoman-generator

FAQs

Package last updated on 18 Aug 2014

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