Coder Social home page Coder Social logo

loopback-es6-sdk's Introduction

Loopback ES6 sdk

Description

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 .

Usage

npm i -g loopback-es6-sdk

cli:

lb-es6 [options] server/app.js (output folder)[src/api/]

options:

-u, --url - URL of the REST API end-point
--help    - Show help

code:

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()

Roadmap

  • Build-in and custom static/instnace methods
  • Basic auth with storing token in localStorage
  • Model relations
  • Configurable authentication

Developing

mocha -t 5000 test/servicec.test.js

And you can watch with livereload your template changes with:

gulp watch

Licence

MIT

loopback-es6-sdk's People

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.