GithubHelp home page GithubHelp logo

rlugojr / tinyreq Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ionicabizau/tinyreq

0.0 2.0 0.0 61 KB

:earth_americas: Tiny library for making http(s) requests.

License: MIT License

JavaScript 100.00%

tinyreq's Introduction

tinyreq

tinyreq

Patreon PayPal AMA Version Downloads Get help on Codementor

Tiny library for making http(s) requests.

☁️ Installation

$ npm i --save tinyreq

💡 ProTip: You can install the cli version of this module by running npm i -g tinyreq-cli

📋 Example

const tinyreq = require("tinyreq");

// Make a request to example.com
tinyreq("http://example.com/", (err, body) => {
    console.log(err || body);
});

// Make a request with custom headers
tinyreq({
    url: "http://example.com/"
  , headers: {
        "user-agent": "Crawler/1.0"
    }
}, (err, body) => {
    console.log(err || body);
});

📝 Documentation

tinyreq(options, callback)

Creates http(s) requests.

Params

  • String|Object options: A string being the request url or an object containing the following fields:
  • url (String): The request url.
  • method (String): The request method.
  • data (Object): The request POST data.
  • encoding (String): The response encoding type.
  • data_encoding (String): The request encoding type.
  • Function callback: The callback function called (with error and data parameters).

Return

  • EventEmitter An event emitter you can use for listening for the data, error and end events.

😋 How to contribute

Have an idea? Found a bug? See how to contribute.

💰 Donations

Another way to support the development of my open-source modules is to set up a recurring donation, via Patreon. 🚀

PayPal donations are appreciated too! Each dollar helps.

Thanks! ❤️

💫 Where is this library used?

If you are using this library in one of your projects, add it in this list. ✨

  • bandcamp-scraper (by Simon Thiboutôt)—A scraper for https://bandcamp.com
  • bnr (by Bloggify)—Access resources (e.g. exchange rates) provided by the National Bank of Romania.
  • cheerio-req—An http request module sending back a Cheerio object.
  • github-colors—GitHub colors and file extensions mapping
  • jsonrequest—A tiny library for requesting and getting JSON resources.
  • mun (by Matheus Alves)—Obter algumas informações de qualquer município do Brasil.
  • page-changed—Call a function when the page body is changed.
  • tinyreq-cli—A cli tool for making http(s) requests. CLI for tinyreq.
  • wrabbit (by jillix)—Wrap scripts by providing the wrapping function.

📜 License

MIT © Ionică Bizău

tinyreq's People

Contributors

ionicabizau avatar erikaugust avatar yomed avatar

Watchers

Ray Lugo, Jr. avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.