2.1.0 • Published 2 years ago

node-proxifyjs v2.1.0

Weekly downloads
25
License
Apache-2.0
Repository
github
Last release
2 years ago

NODE-PROXIFYJS GitHub code size in bytes GitHub package.json version GitHub GitHub last commit npm

node-proxifyjs is a promise based handy module for nodejs developers to find fresh and working free proxies from https://free-proxy-list.net/ by calling only one function

Requirements

  1. node.js
  2. npm

Install and Use

  1. Install from npm

    $ npm i node-proxifyjs
  2. Use

    import proxify from "node-proxifyjs";
    
    (async () => {
      let data = await proxify(); // this will return all 300 proxies
      console.log(data);
    })();

    Importing with require is quite different

    const proxify = require("node-proxifyjs").default;

API

Filtering Parameters

  • Fetching n proxies

    pass an object property count to the function, only number

    import proxify from "node-proxifyjs";
    
    (async () => {
      let data = await proxify({ count: 20 }); // this will return first 20 proxies
      console.log(data);
    })();
  • Fetching google proxies

    pass an object property google to the function, only boolean

    import proxify from "node-proxifyjs";
    
    (async () => {
      let data = await proxify({ google: true }); // pass google: false if you dont want google proxies
      console.log(data);
    })();
  • Fetching https proxies

    pass an object property https to the function, only boolean

    import proxify from "node-proxifyjs";
    
    (async () => {
      let data = await proxify({ https: true }); // pass https: false if you dont want https proxies
      console.log(data);
    })();
  • Fetching country specific proxies

    pass an object property country to the function, only {code?: string, name?: Regrex String}

    Note: Either code or name will work, both of them at same time will not work

    import proxify from "node-proxifyjs";
    
    (async () => {
      let data = await proxify({ country: { code: "US" } }); // pass the name property instead of code if you want to perform regexp search
      console.log(data);
    })();
  • Fetching proxies by type

    pass an object property type to the function, only string

    import proxify from "node-proxifyjs";
    
    (async () => {
      let data = await proxify({ type: "elite proxy" }); // type can be either 'transparent', 'anonymous' or 'elite proxy' only
      console.log(data);
    })();

Note: None, one, some or all filtering predicates can be used at once

proxify({ count: 30, country: { code: "IN" }, type: "elite proxy" });

Returns

interface ICountry {
  code: string; // country code
  name: string; // country name
}

interface IResult {
  host: string; // the ip
  port: number; // port numbeer
  country: ICountry; // country from above interface
  type: string; // type of proxy (elite, anonymous, transparent)
  google: boolean; // is google
  https: boolean; // is https ssl signed
  lastChecked: string; // last checked for working
}

Contribution

Rules

  • Pull requests must be made from another branch, not the master branch
  • Add valid commit message
  • Describe the change in pull request

Scope

  • Documentation
  • Bugs / Suggestions / Feature Requests

License

node-proxifyjs is licensed under Apache-2.0 license