2.0.24 • Published 11 months ago
node-novel-globby v2.0.24
node-novel-globby
globby with sort id/chinese/fullwidth number for node-novel
npm install node-novel-globby
options
- useDefaultPatternsExclude: true
- disableAutoHandle: false
- disableSort: false
- libPromise: Promise from bluebird
- throwEmpty: true - throw error when list is empty
- checkRoman: false - if true will sort roman as number
- sortCallback - sort compare function
defaultPatternsExclude
[
'!**/*.raw.*',
'!**/*.new.*',
'!**/out/**/*',
'!**/raw/**/*',
'!**/*_out/**/*',
'!**/待修正屏蔽字.txt',
'!**/英語.txt',
'!**/node_modules/**/*',
'!**/.*/**/*',
'!**/~*/**/*',
'!**/~*',
'!**/.*',
]
demo
import novelGlobby from 'node-novel-globby';
import { globbyASync, globbySync, returnGlobList } from 'node-novel-globby';
const globbyASync = require('node-novel-globby').globbyASync;
globbyASync(patterns: string[], options: IOptions)
.tap(function (ls)
{
console.log(ls);
})
.then(returnGlobList)
.tap(function (ls)
{
console.log(ls);
})
;
console.log(globbySync());
output
{ temp:
[ { path: 'temp/00000_序曲.txt',
path_dir: 'temp',
dir: 'temp',
file: '00000_序曲',
ext: '.txt',
volume_title: 'temp',
chapter_title: '序曲',
val_file: '00000_序曲',
val_dir: 'temp' },
{ path: 'temp/0000_转载信息.64849.txt',
path_dir: 'temp',
dir: 'temp',
file: '0000_转载信息.64849',
ext: '.txt',
volume_title: 'temp',
chapter_title: '转载信息',
val_file: '0000_転載信息.64849',
val_dir: 'temp' },
{ path: 'temp/六話 練級 経験值来源都多虧了山賊.txt',
path_dir: 'temp',
dir: 'temp',
file: '六話 練級 経験值来源都多虧了山賊',
ext: '.txt',
volume_title: 'temp',
chapter_title: '六話 練級 経験值来源都多虧了山賊',
val_file: '0006_練級_経験值来源都多虧了山賊',
val_dir: 'temp' },
{ path: 'temp/123.txt',
path_dir: 'temp',
dir: 'temp',
file: '123',
ext: '.txt',
volume_title: 'temp',
chapter_title: '123',
val_file: '0123',
val_dir: 'temp' } ] }
with returnGlobList
[ 'temp/00000_序曲.txt',
'temp/0000_转载信息.64849.txt',
'temp/六話 練級 経験值来源都多虧了山賊.txt',
'temp/123.txt' ]
getOptions(patterns, options)
1
let ret = getOptions(patterns, options);
[patterns, options] = [ret.patterns, ret.options];
2
[patterns, options] = getOptions(patterns, options);
use like globby
import globby, { globbyASync, globbySync } from 'node-novel-globby/g';
globby(patterns, options)
globby.sync(patterns, options)
globby.async(patterns, options)
globbyASync(patterns, options)
globbySync(patterns, options)
2.0.24
11 months ago
2.0.23
2 years ago
2.0.22
2 years ago
2.0.21
2 years ago
2.0.20
2 years ago
2.0.19
3 years ago
2.0.18
5 years ago
2.0.16
5 years ago
2.0.17
5 years ago
2.0.13
5 years ago
2.0.12
5 years ago
2.0.11
5 years ago
2.0.9
6 years ago
2.0.7
6 years ago
2.0.6
6 years ago
2.0.5
6 years ago
2.0.4
6 years ago
2.0.3
6 years ago
2.0.2
6 years ago
2.0.1
6 years ago
1.7.11
7 years ago
1.7.10
7 years ago
1.7.9
7 years ago
1.7.8
7 years ago
1.7.7
7 years ago
1.7.6
7 years ago
1.7.5
7 years ago
1.7.4
7 years ago
1.7.3
7 years ago
1.7.2
7 years ago
1.7.1
7 years ago
1.7.0
7 years ago
1.6.9
7 years ago
1.6.8
7 years ago
1.6.7
7 years ago
1.6.6
7 years ago
1.6.5
7 years ago
1.6.4
7 years ago
1.6.3
7 years ago
1.6.2
7 years ago
1.6.1
7 years ago
1.6.0
7 years ago
1.5.2
7 years ago
1.5.1
7 years ago
1.5.0
7 years ago
1.4.3
7 years ago
1.4.2
7 years ago
1.4.1
7 years ago
1.4.0
7 years ago
1.3.4
7 years ago
1.3.3
7 years ago
1.3.2
7 years ago
1.3.1
7 years ago
1.3.0
7 years ago
1.2.2
7 years ago
1.2.1
7 years ago
1.2.0
7 years ago
1.1.0
7 years ago
1.0.0
7 years ago