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

concatter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

concatter

Single-file app js concat utility

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Concatter

Helper utility to build single-file JavaScript applications. It uses NodeJS-styled require function calls to resolve file concatenation order. It is quite experimental at the moment and does not support cyclic dependencies.

Usage

$ concatter --help

  Usage: concatter [options]

  Options:

    -h, --help             output usage information
    -b, --base <path>      base path for modules
    -i, --indent <indent>  indent for module wrapping
    -o, --output <path>    name of the output file
    -V, --version          output the version number

Example

Lets say we have project with the following structure:

example/
|-- module1
|   `-- a.js
|-- module2
|   `-- b.js
`-- module3
    `-- c.js

and a.js, b.js, c.js are following:

a.js:

var b = require('../module2/b');

exports.a = function() {
    console.log(b.b());
};

b.js:

var c = require('../module3/c');

exports.c = function() {
    console.log(c.c());
};

c.js:

exports.c = function() {
    console.log('c');
};

then the project is compiled to a single file using the command concatter --base example which results in the following output:

module1 = {};
module1.a = {};
module2 = {};
module2.b = {};
module3 = {};
module3.c = {};

module3.c = (function(exports) {
    exports.c = function() {
        console.log('c');
    };

    return exports;
})({});

module2.b = (function(exports) {
    var c = module3.c;

    exports.c = function() {
        console.log(c.c());
    };

    return exports;
})({});

module1.a = (function(exports) {
    var b = module2.b;

    exports.a = function() {
        console.log(b.b());
    };

    return exports;
})({});

FAQs

Package last updated on 19 Aug 2012

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