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

build-modules

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-modules

`build-modules` ============

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
decreased by-18.75%
Maintainers
1
Weekly downloads
 
Created
Source

build-modules

Builds modules of different formats from a CommonJS (node.js style) source file. Builds AMD and traditional globalized browser module pattern files, minified and non-minified.

Install

npm install build-modules

Example

var build = require('buildModules')
build('outputDirectory/', 'moduleName', '/*Some Header - probably a copywrite*/', 'some/path/to/file.js', function(error) {
   // done
})

Why use build-modules over...

  • Browserify - build-modules uses browserify under the hood, but makes it much simpler to put together simple umd packages.

Usage

buildDirectory, name, header, modulePath

build(<outputDirectory>, <moduleName>, <header>, <modulePath>, <errback>)
  • <outputDirectory> is the directory in which the built files are created
  • <moduleName> is name of the module
  • <header> is a header included in each built file
  • <modulePath> is the path of the file to build
  • <errback> is a node.js errback function (first argument is error) that is called when build is finished.

Outputs the following files:

  • A minified and unminified universal module
  • A sourcemap file for mapping from the minified to the non-minified modules for both amd and globalized versions.

Todo

  • create unit tests that test source maps

How to Contribute!

Anything helps:

  • Creating issues (aka tickets/bugs/etc). Please feel free to use issues to report bugs, request features, and discuss changes
  • Updating the documentation: ie this readme file. Be bold! Help create amazing documentation!
  • Submitting pull requests.

How to submit pull requests:

  1. Please create an issue and get my input before spending too much time creating a feature. Work with me to ensure your feature or addition is optimal and fits with the purpose of the project.
  2. Fork the repository
  3. clone your forked repo onto your machine and run npm install at its root
  4. If you're gonna work on multiple separate things, its best to create a separate branch for each of them git checkout -b my-feature-branch
  5. edit!
  6. If it's a code change, please add to the unit tests (at test/test.js) to verify that your change
  7. When you're done, run the unit tests and ensure they all pass
  8. Commit and push your changes
  9. Submit a pull request: https://help.github.com/articles/creating-a-pull-request

Change Log

  • 1.0.4 - changing api to pass in the module path as the 4th parameter instead of the module contents
  • 1.0.2 - now uses browserify and just outputs umd packages.
  • 1.0.1 - now supports modules with dependencies!

License

Released under the MIT license: http://opensource.org/licenses/MIT

FAQs

Package last updated on 16 Jan 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

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