Giter Site home page Giter Site logo

js-packager's Introduction

js-packager

JS packager is a javascript build helper.

Basics

Takes a directory structure of javascript packages (module.exports...)

├── root.js
└── util
    ├── convert.js
    └── validation
        └── is-valid.js

and compiles a javascript library from it such that each file is accessible by

myLib.util.validation.IsValid == // module.exports from util/validation/is-valid.js

Require

References to other files may be done using node.js require syntax.

// e.g.
// contents of convert.js

var strToIntConv = function(value){
	return parseInt(value, 10);
};

module.exports = {
	ToInt: strToIntConv
};

// contents of is-valid.js 

var conv = require("../convert.js");

var IsValid = function(value){
	return !IsNaN(conv.ToInt(value));
};

module.exports = IsValid;

Usage

var packager = require("js-packager")

packager({
	"src_dir" : "./sample-data",
	"output_file": "./my-lib.js",
	"package_name": "MyLib",
	"skip_files_matching": /\.test\.js/
})
	

Test

Run tests using ./test.sh

js-packager's People

Contributors

nbosscher avatar ntbosscher avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.