1.1.3 • Published 5 years ago
api-generator v1.1.3
API Generator
An API generation library for NodeJS.
Installation
$ npm install api-generatorUsage
let apiGen = require('api-generator');
let config = {
"name" : "fetchGithubApiEndpoints",
"type" : "REQUEST",
"methods" : [
{
"type" : "GET",
"url" : "https://api.github.com",
"callback": function (err, data) {
if (!err) {
console.log("Success!", data);
}
console.log("Error!", err);
}
}
]
};
let myApi = apiGen([config]);
console.log(myApi);
// => { fetchGithubApiEndpoints: { GET: [Function] } }Tests
Coming soon...
$ npm testNote: This requires mocha, should, and underscore.
Features
- Automatic API Generation
- Easily extensible
- Simplifies repeated API generation