just-get-json

0.1.3 • Public • Published

just-get-json

If you know, that specific URL or HTTP API request returns nothing but JSON data, use this module to get it.

Pass URL. Get JS object. No annoying callbacks.

Usage

var gj = require('just-get-json');
 
request = "http://jsonplaceholder.typicode.com/posts/1";
result = gj(request);
 
console.log(result);
 
/*
result:
{ userId: 1,
  id: 1,
  title: 'sunt aut facere repellat provident occaecati excepturi optio reprehenderit',
  body: 'quia et suscipit\nsuscipit recusandae consequuntur expedita et cum\nreprehenderit molestiae ut ut quas totam\nnostrum rerum est autem sunt rem eveniet architecto' }
*/

Generating docs

In package folder run:

$ ./node_modules/jsdoc/jsdoc.js index.js README.md

Start browsing from ./out/index.html

Source annotation at ./out/module-just-get-json.html

Disclaimer

Please note (if someone even once read this), this package is sort of joke and was made me to learned how to make npm packages. There are (I believe) more effective ways to do the same job without dependencies. Despite this I use it myself and it works well for me :)

Dependents (0)

Package Sidebar

Install

npm i just-get-json

Weekly Downloads

2

Version

0.1.3

License

MIT

Last publish

Collaborators

  • ramilmuratov