1.0.7 • Published 5 years ago

node-extract v1.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

extract.js

Assembly of modules node.js into one file

Install

npm i node-extract

Usage

const extract = require('node-extract');
extract({ 
  /* configuration */ 
}, () => {
  /* callback */
});

Configuration

ParamTypeDefaultDescription
inputstringnullInput .js file path
outputstringnullOutput .js file path
debugint1Debug level (0-2)
depthint30Maximum iteration depth
excludearray[]Listing of exclude files
sharearray[]Listing of not require files
polyfillbooleantrueUse polyfills in modules

Example

const extract = require('node-extract');
extract({
  input: 'index.js',
  output: 'index.dist.js',
  debug: 1,
  exclude: [
    './config.json'
  ],
  share: [
    'socket.io-client/dist/socket.io.js.map',
    'socket.io-client/dist/socket.io.js'
  ]
});

INPUT index.js

var server = require('http');
var io = require('socket.io');
var localConfig = require('./config.json');
var colors = require('colors');

OUTPUT index.dist.js

var server = require('http'); // is default node module
var io = $___module___10055();
var localConfig = require('./config.json'); // is exclude
var colors = $___module___10067();
// ...
function $___module___10055() {
  var exports = {};
  var module = { exports };
  // module body
  return module.exports;
}
// ...

console

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago