globcat
Concatenate files from command line with glob pattern.
Last updated 10 months ago by smonn .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install globcat 
SYNC missed versions from official npm registry.

Travis Dependency Status Coverage Status npm module downloads npm version node version npm license GitHub issues prettier.io

globcat

Concatenate files from command line with glob pattern.

Install

npm install [--global] globcat

Usage

const globcat = require('globcat')
const options = { /*...*/ }

// just the one...
globcat('**/*.txt', (err, contents) => {
  // contents contains the file contents of the matched files
  // err is an error object or null
})

// ... or with array
globcat(['path/to/file.txt', 'other/path/*.txt'], options, (err, contents) => {
  // contents contains the file contents of the matched files
  // err is an error object or null
})

// as promise
globcat(['path/to/file.txt', 'other/path/*.txt'], options)
  .then(function(contents) {
    // use contents
  })
  .catch(function(err) {
    // handle error
  })

Options

  • stream Set to true to get a readable stream instead of string in the callback. Defaults to false.
  • glob Is passed through to glob. For option details please view the glob package. Thanks glob and minimatch for your excellence! :)

Command Line

Using CLI arguments:

globcat path/*.txt other/**/*.txt --output combined.txt

Using pipes:

cat file-with-paths.txt | globcat > combined.txt

Oneliner without installing using npx, use --quiet to suppress output from npx itself:

npx --quiet globcat *.txt > all.txt

To see available options run globcat --help.

Current Tags

  • 1.1.3                                ...           latest (10 months ago)

27 Versions

  • 1.1.3                                ...           10 months ago
  • 1.1.1                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.5                                ...           a year ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           3 years ago
  • 1.0.1                                ...           3 years ago
  • 1.0.0                                ...           3 years ago
  • 0.7.0                                ...           3 years ago
  • 0.6.0                                ...           3 years ago
  • 0.5.1 [deprecated]           ...           3 years ago
  • 0.5.0 [deprecated]           ...           3 years ago
  • 0.4.1 [deprecated]           ...           3 years ago
  • 0.4.0 [deprecated]           ...           3 years ago
  • 0.3.2 [deprecated]           ...           3 years ago
  • 0.3.0 [deprecated]           ...           3 years ago
  • 0.2.3 [deprecated]           ...           4 years ago
  • 0.2.2 [deprecated]           ...           4 years ago
  • 0.2.1 [deprecated]           ...           4 years ago
  • 0.2.0 [deprecated]           ...           4 years ago
  • 0.1.6 [deprecated]           ...           4 years ago
  • 0.1.5 [deprecated]           ...           4 years ago
  • 0.1.4 [deprecated]           ...           4 years ago
  • 0.1.3 [deprecated]           ...           4 years ago
  • 0.1.2 [deprecated]           ...           4 years ago
  • 0.1.1 [deprecated]           ...           4 years ago
  • 0.1.0 [deprecated]           ...           4 years ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 2
Last Day 0
Last Week 1
Last Month 54
Dependencies (5)
Dev Dependencies (11)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |