New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

koncat

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koncat

Concatenates (transformed) filenames into a file

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

koncat

Concatenate filenames into a single file.

Node.js Usage

concat files as is with titles between

const koncat = require('.')

koncat({
  inputFiles: input,
  outputFile: output,
  title: '// file: {path}'
})

create js file with requires

const koncat = require('.')

koncat({
  inputFiles: ['tests/**/*_test.js'],
  outputFile: 'tests_main.js',
  transform: function(path) {
    var out = [];
    out.push("// require module " + path);
    out.push("require('" + path + "');");
    out.push("\n");
    return out.join("\n");
  }
})

For a directory with the structure

- tests/
  - utils_test.js
  - controllers/
    - index_test.js
    - list_test.js

this creates a file at tests_main.js with the content

// require module tests/utils_test.js
require("tests/utils_test");

// require module tests/controllers/index_test.js
require("tests/controllers/index_test");

// require module tests/controllers/list_test.js
require("tests/controllers/list_test");

CLI Usage

  • -t'... {path} ...' - add titles with file paths
koncat '*.js' > bundle.js
koncat -t '/*< file: {path} */' -- '*.js' > bundle.js
koncat -o bundle.js -t '//< file: {path}' -- '*.js'
koncat -t '' -- '*.js' # defalut title

Keywords

concatenate

FAQs

Package last updated on 31 Jul 2016

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