tiny-network

0.0.6 • Public • Published

tiny-network

super tiny http library

Build Status

Installation

$ npm install tiny-network

Example

const { get, readStream } = require('tiny-network');

Promise
.resolve()
.then(() => get('https://httpbin.org/get'))
.then(ensureStatusCode(200))
.then(readStream)
.then(JSON.parse)
.then(response => {
  console.log(response);
});

Async/Await

const { get, readStream } = require('tiny-network');

(async () => {

  const response = await get('https://httpbin.org/get');
  console.log(response.statusCode);

  const body = await readStream(response);
  console.log(JSON.parse(body));

})();

Contributing

  • Fork this Repo first
  • Clone your Repo
  • Install dependencies by $ npm install
  • Checkout a feature branch
  • Feel free to add your features
  • Make sure your features are fully tested
  • Publish your local branch, Open a pull request
  • Enjoy hacking <3

MIT

This work is licensed under the MIT license.


Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.65latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.65
0.0.50
0.0.40
0.0.30
0.0.20
0.0.00

Package Sidebar

Install

npm i tiny-network

Weekly Downloads

0

Version

0.0.6

License

MIT

Unpacked Size

7.22 kB

Total Files

8

Last publish

Collaborators

  • song940