3.1.1 • Published 5 months ago

globcat v3.1.1

Weekly downloads
3,174
License
MIT
Repository
github
Last release
5 months ago

globcat

npm module downloads npm version node version npm license GitHub issues prettier.io

Concatenate files in alphabetical order from command line with glob pattern.

Install

npm install [--global] globcat

Usage

import globcat from '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.

3.1.0-0

5 months ago

3.1.0-1

5 months ago

3.1.1

5 months ago

3.1.0

5 months ago

3.0.1

1 year ago

3.0.0

1 year ago

2.0.1

2 years ago

2.0.0

3 years ago

1.3.4

3 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.3

5 years ago

1.1.1

6 years ago

1.1.0

6 years ago

1.0.5

6 years ago

1.0.3

7 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.7.0

8 years ago

0.6.0

8 years ago

0.5.1

8 years ago

0.5.0

8 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.3.2

8 years ago

0.3.0

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.6

8 years ago

0.1.5

9 years ago

0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago

0.0.1

9 years ago