@nathanfaucett/comn
comn is a commonjs compiler
Last updated 4 years ago by nathanfaucett .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @nathanfaucett/comn 
SYNC missed versions from official npm registry.

comn

comn is a commonjs compiler

$ comn -f ./path/to/file -o ./path/to/out
var comn = require("comn");


var out = comn("path/to/index.js", {
    parseAsync: false,
    builtin: {},
    mappings: {},
    packageType: "main"
});

// single file output
fs.writeFileSync("path/to/out/file.js", out.entry().source);

// if parsed async deps
out.each(function(chunk) {
    fs.writeFileSync("path/to/out/file.js", "//# sourceMappingURL=./path/to/sourceMap\n" + chunk.source);
});

// will generate source maps for each entry
out.generateSourceMaps();

out.each(function(chunk) {
    fs.writeFileSync("path/to/out/file.js.map", chunk.sourceMap.toJSON());
});

Async Parsing

// can load node modules or files parses path/to/file into separate file unless
// the parseAsync option is false
require.async("path/to/file", function(file) {
    console.log(file);
});

Current Tags

  • 0.0.13                                ...           latest (4 years ago)

13 Versions

  • 0.0.13                                ...           4 years ago
  • 0.0.12                                ...           4 years ago
  • 0.0.11                                ...           4 years ago
  • 0.0.10                                ...           4 years ago
  • 0.0.9                                ...           4 years ago
  • 0.0.8                                ...           4 years ago
  • 0.0.7                                ...           4 years ago
  • 0.0.6                                ...           4 years ago
  • 0.0.5                                ...           4 years ago
  • 0.0.4                                ...           4 years ago
  • 0.0.3                                ...           5 years ago
  • 0.0.2                                ...           5 years ago
  • 0.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 4
Last Day 1
Last Week 1
Last Month 1
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |