【文件属性】:
文件名称:grepy:grep 足够智能的包装器
文件大小:7KB
文件格式:ZIP
更新时间:2021-06-17 01:22:38
JavaScript
灰色的
使用 JSON 输出封装命令行 grep
安装
npm install --save grepy
用法
打回来
grepy ( pattern , path , args , function ( match ) {
...
} )
溪流
grepy发出一条已解析的行,因此可以“即时”处理数据而无需缓冲。 感谢这里的流。
grepy . stream ( pattern , path , args )
输出格式
[
{ filename : < filename> , lineNumber: < line> ,
chunks: [
{ str : < substring> , matched < true> } ,
{ str : < substring> , matched < true |
【文件预览】:
grepy-master
----.gitignore(23B)
----package.json(617B)
----index.js(2KB)
----README.md(2KB)
----test()
--------expected-outputs_right_matches_and_line_numbers.json(463B)
--------expected-outputs_lines_with_matches.json(67B)
--------test.txt(185B)
--------helpers.js(443B)
--------expected-handles_matches_at_begin_and_end.json(216B)
--------expected-skips_context_delimiter.json(926B)
--------expected-handles_whole_line_match.json(1KB)
--------expected-handles_ignore_case.json(539B)
--------test.js(3KB)
--------expected-outputs_last_not_matched_character.json(462B)