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

`buildModules` ============

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
30
increased by114.29%
Maintainers
1
Weekly downloads
 
Created
Source

buildModules

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*/', moduleContents)

Usage

build(<outputDirectory>, <moduleName>, <header>, <moduleContents>[, <options>], <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
  • <moduleContents> is a string containing the contents of the original commonJs module
  • <options> (optional) is an object containing any of the following properties:
    • amd: a custom name for the amd file (default: <moduleName>+'.amd.js')
    • minAmd: a custom name for the minified amd file (default: <moduleName>+'.amd.min.js')
    • global: a custom name for the global browser file (default: <moduleName>+'.global.js')
    • minGlobal: a custom name for the minified global browser file (default: <moduleName>+'.global.min.js')
  • <errback> is a node.js errback function (first argument is error) that is called when build is finished.

Outputs the following files:

  • Minified and unminified AMD modules
  • Minified and unminified browser modules with a single globalized name (dependencies, however, are hidden - not globalized)
  • A sourcemap file for mapping from the minified to the non-minified modules for both amd and globalized versions.

Todo

  • Support modules with dependencies (via require-traverser)
  • 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.1 - now supports modules with dependencies!

License

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

FAQs

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