json-ext

helper modules to throw JSON objects at any JSON/REST api

npm install json-ext
36 downloads in the last week
72 downloads in the last month

json-ext Build Status

NPM
helper modules to throw JSON objects at any JSON/REST api can also be considered an API framework.

Getting Started

Install the module with: npm install json-ext

var jsonExt = require('json-ext');
jsonExt.baseUrl('http://example.com'); // set base url for the api
// if the api requires basic authentication use the in-built constructor.
jsonExt.basicAuthentication = {
  userId: "my-id",
  username: "JohnDoe",
  password: "myPassWord",
}

Documentation

Current Stability = stablish!

Supported [
  'GET'
  'POST' 
  'PUT' 
  'DELETE' 
  'Authentication'
]
Not Supported [
  SSL
]

Examples

Making a Non-Authenticated GET Request

var jsonExt = require('json-ext');

jsonExt.baseUrl('http://example.com');

jsonExt.get('/users/');

Making a Non-Authenticated POST Request

var jsonExt = require('json-ext');

jsonExt.baseUrl('http://example.com');

var newUser = {
  id = 1,
  name = 'John',
  password = 'secret',
  website = 'http://johndoe.com'
}

jsonExt.post('/users/new', newUser);

Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using Grunt.

Release History

  • 1.0.0
    • new API and is somewhat stable
  • 0.4.2
    • added authentication support for PUT POST and DELETE requests
  • 0.4.1
    • added authentication support for GET requests
  • 0.4.0
    • version bump nothing more
  • 0.3.1
    • added colors and api documentation through grunt
  • 0.2.x - 0.3.0
    • alot of fixes and added logging
  • 0.1.4
    • some patches and object fixes
  • 0.1.0
    • unstable release
  • 0.0.1
    • get requests!!!

License

Copyright (c) 2013 Josh Burns. Licensed under the MIT license.

npm loves you