Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

micro-packager

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

micro-packager

Library to extract part of an npm package and create a new smaller npm package that contains only the component pieces required.

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

Micro Packager

Library to extract part of an npm package and create a new smaller npm package that contains only the component pieces required. Just point the packager to the main root file and the application will be spidered and pull in all required dependencies.

In addition to extracting the smaller application, there is also the option to deploy to AWS Lambda to run the smaller application as a function.

NOTE: This is a very rough first pass at the application. The actual process can be cleaned up but at the moment just trying to work on a PoC.

Usage

var packager = require('micro-packager');

// put all the options together...
var opts = {
    package_name: '',
    app_root: '',
    output_dir : '',
    root_file: '',
    execution_file: '',
    additional_files : [],
    required_modules: {},
    delete_temp_dir: false,
    remove_directories : [],
    include_node_modules : true
};

// Build the package...
packager.build(opts, function(err, results){
    console.log(arguments);
});

Options

  • package_name : The name that should be assigned to the new package.
  • app_root : The absolute path to the root of the parent/source application.
  • output_dir : The directory the zip file should be written to.
  • root_file : The file that should be used to start the spidering to get all the component pieces.
  • execution_file : The file that holds the code that will serve as the execution file in the new application.
  • additional_files : An array of any additional files that need to be included in the new application.
  • required_modules : An array of any additional npm modules that need to be included in the new application.
  • delete_temp_dir : If the temporary directory should be removed after creation. Default true.
  • remove_directories : An array of directories that should be removed to decrease the size of the application. In some cases npm modules have a build directory that can be removed after the npm install has run.
  • include_node_modules : If the node_modules directory should be included.

Keywords

FAQs

Package last updated on 09 Dec 2015

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