Noteworthy Placebo Mongers


    1.2.1 • Public • Published


    npm dependency status for latest release GitHub top language NPM

    npm npm


    Minify and Forge your node.js files for production.

    • Tracks down local required files, and adds them to the parent file as a self running function.

    • Minifies each file individually, and then as a whole.

    • Allows your file to run standalone, and not depend on miniforge-js to run.


    • Compresses the file, and decompress it at runtime
    • Encrypts the file, and decrypts it at runtime

    This module Never uses eval. Instead, the file is pushed into the nodejs module object, as a way to run the file as a string after decompression. This is generating a virtual file, so no file writes are needed at runtime.

    This module runs a minified version of itself, minified using miniforge-js. (self minified)

    What's New

    • Added zlib compression
    • Top level comments now stay with compressed file
    • Added option to avoid dependencies on file compression


    npm install @aspiesoft/miniforge-js
    # or install as a dev dependency
    npm install @aspiesoft/miniforge-js -D
    # or install global for cli
    npm install @aspiesoft/miniforge-js -g


    const miniforge = require('@aspiesoft/miniforge-js');
    // optional

    Usage'./app.js', {/* options */});
    // output creates file:'./app.js', {encrypt: true});
    // output will also create key file:
    // running files
    const app = require('./');
    // in some cases (depending on options), you may have to require the file with this module
    const app = miniforge('./', true||false/*optional (default: false) (if true, will avoid throwing errors on fail*/);
    // you could also change the var name if you want
    const requireMini = require('miniforge-js');
    const app = requireMini('./');

    This module uses the terser module for magnifying

    This module sets some of its own defaults for terser, but you can change its options if you want. You can find terser options here'./app.js', {minify: {/* terser minify options */}});


    // with defaults (the first string ('./app.js') has no default and is required)'./app.js', {
        encrypt: false, /* encrypt the files code */
        compress: true, /* true for default (currently zlib) || 'lzutf8' for old lzutf8 method || false to disable */
        standAlone: true, /* allow the file to run without miniforge-js as a dependency */
        avoidDependencies: true, /* avoid requiring external dependencies for compressed files */
        minify: {}, /* set minify options for the terser module */
        outputNameMin: false, /* will write output to "filename.min.js" instead of "" (will also use min.keys instead of build.keys) */
        output: undefined, /* (type: string) optional path to an output file to use instead of the default path */
        root: undefined, /* (type: string) set the root dir for build (can replace miniforge.rootDir(__dirname); for build, but its still required for miniforge('./app.js'); function to run) */


    You can use cli scripts as shown

    # for a list of commands
    miniforge-js -h

    Note: if encrypt or compress are used, and standAlone is false, you will need to use miniforge('./app.js'); method to require the file.

    If standAlone, the file (when ran/imported) will warn the user what modules (if not installed) are needed to run it.


    npm i @aspiesoft/miniforge-js

    DownloadsWeekly Downloads






    Unpacked Size

    27.6 kB

    Total Files


    Last publish


    • aspiesoft