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

request-regexp

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

request-regexp

一个正则请求过滤器

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

node-request-regexp

基于request的一个正则请求过滤器

install

$ npm install request-regexp

example

var request = require('request-regexp');

request({
    url: 'http://www.qq.com/',
    encoding: 'gb2312',//如果是gb2312编码
    regexp: {//一个正则对象
        title: '<title>(.+?)</title>',
        keyword: '<meta content="(.+?)" name="Keywords">',
        description: '<meta name="description" content="(.+?)" />'
    }
}, function(error, response, body) {
    if (error) {
        console(error.message);
    }
    else {
        // body = {
        //     title: [
        //         匹配数组1,
        //         匹配数组2,
        //     ]
        // }
        console.log(body);
    }
});

change log

1.0.3

  • 优化文档

1.0.2

  • 添加文档
  • 添加demo

Keywords

request

FAQs

Package last updated on 16 Jan 2017

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