Skip to content
/ og-js Public

A set of libraries build to interact with API's simple, beautiful and powerful.

Notifications You must be signed in to change notification settings

dmarte/og-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OgJs

Is a set of libraries in for JavaScript to interact with API's as resources and collections.

But, what?

// You can turn this
const data = {
 name: 'John'
}

const user = axios.post('/api/path', data)


// Into this

const user = new User(api, { name: 'John' })

user.save();
// Also you can query like this:
const user = new User(api, { name: 'John', email: '[email protected]' });

user.where('email', '[email protected]').find();

// Or fail if negative response
try {
   user.findOrFail();
 } catch() {
   console.log(user.response.message);
 }

About

A set of libraries build to interact with API's simple, beautiful and powerful.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published