1.0.1 • Published 4 years ago

jsonphapi v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

JSONPlaceholder JS client 🚧(in development)

JavaScript client to facilitate the use of the JSON Placeholder API.

Installation

npm i jsonphapi

Usage

jsonphapi supports ES6 imports and CommonJS require.

// ES6
import { getUser } from 'jsonphapi';
// CommonJS
const { getUser } = require('jsonphapi');

Methods:

  • getUser()
  • getPost()
  • getComment()
  • getPhoto()
  • getAlbum()
  • getTodo()

Examples

import { getUser } from 'jsonphapi';

const userOne = await getUser(1); // returns user with ID 1

Filtering

import { getUser } from 'jsonphapi';

const antonette = getUser({ username: 'Antonette' });