Skip to content
Create a RESTful service with ES7 decorators for your node.js application.
Branch: master
Clone or download
mseemann Merge pull request #129 from mseemann/greenkeeper/ts-loader-2.3.0
Update ts-loader to the latest version 🚀
Latest commit 8482220 Jul 27, 2017
Type Name Latest commit message Commit time
Failed to load latest commit information.


Create a RESTful service with ES7 decorators for your node.js application.

CI Status npm version Coverage Status Code Climate Issue Count Test Coverage Issue Stats


npm install js-restful --save

Make sure you have a shim for es7 reflect. For example core-js or reflect-metadat.

Usage Extend your node js service class with decorators (this is TypeScript with decorators!):

import { GET, POST, PUT, DELETE, Path, PathParam, HeaderParam, QueryParam } from 'js-restful';

class Book {
    name: string;

class BookService {

    allBooks() : Book[]{
       return [];

    createBook(@PathParam('name') name:string, @HeaderParam('token') token:string) :Book {
        return {id:1, name:name};

    updateBook(@PathParam('id') id:number, @PathParam('name') name:string) : Book {
        return {id:id, name:name};

    deleteBook(@PathParam('id') id:number, @QueryParam('time') time:number): boolean {
        return true;

Later (at runtime) you can use the parser to get back all of these information:

import { ServiceDescription, ServiceParser } from 'js-restful';

let serviceDescription = ServiceParser.parse(bookService);

The result is a complete description of your Service:


Ok! But what can I do with this? Have a look at the github project js-restful-express.

This is a base project that different implementations can use to integrate this information in a concrete node js framework.

You can’t perform that action at this time.