Static code generator for Loopback models. It is generates vanila es6 classes (or you can transpile code to ES5, whatever it is still old plain javascript class) for each public model. Static and instance methods return promises according to your model definition. Static properties proposal used, so you need preset stage-2 in your .babelrc
.
npm i -g loopback-es6-sdk
lb-es6 [options] server/app.js (output folder)[src/api/]
-u, --url - URL of the REST API end-point
--help - Show help
import { LoobpackModel } from './your_api_folder';
LoobpackModel
.findOne({ filter })
.then((model) = {
model.name = 'hello';
return model.save();
})
.catch((error) => {/* ... */ })
or
new LoobpackModel({ name: 'again' }).save().catch()
- [x] Build-in and custom static/instnace methods
- [x] Basic auth with storing token in localStorage
- [ ] Model relations
- [ ] Configurable authentication
mocha -t 5000 test/servicec.test.js
And you can watch with livereload your template changes with:
gulp watch
MIT