New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

fs-grep

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fs-grep

Contents of the file grep

latest
Source
npmnpm
Version
0.0.5
Version published
Weekly downloads
38
111.11%
Maintainers
1
Weekly downloads
 
Created
Source

fs-grep

Contents of the file grep

code style fecs NPM Version NPM Downloads Linux Build Windows Build Test Coverage Dependencies DevDependencies

Cli

# install
[sudo] npm install -g fs-grep

# pattern => 需要匹配的内容,如果有空格需要使用引号包裹
# files => 以glob的方式,比如"./**/*""./**/*.ext"
fs-grep <pattern> [files]

# 例子:查找当前目录下的包含所有test的文件
fs-grep test

# 例子:查找所有.md
fs-grep test "./**/*.md"

# 例子:搜索词高亮
fs-grep --color test

Api

使用npm install fs-grep安装

.exec

var read = fsGrep.exec(pattern, files);

read.on('line', function (path, index, content) {
    // path => 文件路径
    // index => 文件行数
    // content => 匹配的内容
});


read.on('end', function (data) {
    data = [
        {
            path: '',
            data: [
                {
                    index: '',
                    content: ''
                }
            ]
        }
    ];
});

Keywords

fs

FAQs

Package last updated on 21 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts