3.1.1 • Published 2 years ago
globcat v3.1.1
globcat
Concatenate files in alphabetical order from command line with glob pattern.
Install
npm install [--global] globcatUsage
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
streamSet totrueto get a readable stream instead of string in the callback. Defaults tofalse.globIs 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.txtUsing pipes:
cat file-with-paths.txt | globcat > combined.txtOneliner without installing using npx, use --quiet to suppress output from
npx itself:
npx --quiet globcat *.txt > all.txtTo see available options run globcat --help.
3.1.0-0
2 years ago
3.1.0-1
2 years ago
3.1.1
2 years ago
3.1.0
2 years ago
3.0.1
3 years ago
3.0.0
3 years ago
2.0.1
4 years ago
2.0.0
4 years ago
1.3.4
5 years ago
1.3.3
6 years ago
1.3.2
6 years ago
1.2.2
6 years ago
1.2.1
6 years ago
1.2.0
6 years ago
1.1.3
7 years ago
1.1.1
8 years ago
1.1.0
8 years ago
1.0.5
8 years ago
1.0.3
9 years ago
1.0.2
9 years ago
1.0.1
10 years ago
1.0.0
10 years ago
0.7.0
10 years ago
0.6.0
10 years ago
0.5.1
10 years ago
0.5.0
10 years ago
0.4.1
10 years ago
0.4.0
10 years ago
0.3.2
10 years ago
0.3.0
10 years ago
0.2.3
10 years ago
0.2.2
10 years ago
0.2.1
10 years ago
0.2.0
10 years ago
0.1.6
10 years ago
0.1.5
10 years ago
0.1.4
10 years ago
0.1.3
10 years ago
0.1.2
10 years ago
0.1.1
10 years ago
0.1.0
10 years ago
0.0.1
11 years ago