This package has been deprecated

Author message:

end of development

padex
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

Padex

Get response of some urls among linked pages

npm: padex CircleCI Coverage Status tested with jest code style: prettier license: mit TypeScript

Install

yarn add [-D] padex

Example

import * as url from 'url';
import {Padex} from 'padex';
 
const padex = new Padex('https://example.com', {
    //# In the below, Default values.
 
    //## Whether takes a urls from head tag of a got html
    head: false,
    //## Sleep time between request and next request
    sleep: 400,
    //## How many times to move
    deep: 3,
    //## Whether to allow requests for current url
    //   The following examines whether the URL passed to `Padex`
    //   and the `hostname` of the current URL are together.
    validate: ({url: currentUrl, location}) => {
        const currentLocation = url.parse(currentUrl);
 
        return currentLocation.hostname === location.hostname;
    }
})
 
(async () => {
    const result = await padex.process();
    // result === {
    //   url: 'https://example.com',
    //   options: {head, sleep, deep, validate},
    //   root: Document,
    //   documents: Document[],
    // }
})();

Readme

Keywords

none

Package Sidebar

Install

npm i padex

Weekly Downloads

1

Version

0.1.3

License

MIT

Unpacked Size

31 kB

Total Files

26

Last publish

Collaborators

  • nju33