npm.io
0.3.0 • Published 7 years agoCLI

express-ts-starter

Licence
MIT
Version
0.3.0
Deps
10
Size
18 kB
Vulns
1
Weekly
0

express-ts-starter

Generate typescript express application npm license github-issues

nodei.co

travis-status stars forks

forks

Features

  • Generate typescript express application
  • Support i18n

Usage

Usage: express-ts-starter [options] [command]

Options:
  -h, --help  output usage information

Commands:
  start       Generate express application

Sample

// lib/routes/landing.ts
// ======
// package-dependency import *  from '@decorators/express';
import { Controller, Get, Response } from '@decorators/express';

@Controller('/')
export class LandingController {
  @Get('/')
  landing(@Response() res: any) {
    console.log();
    res.serve('landing', {
      greetings: res.__('greetings', { name: 'World' }),
      welcome: res.__('welcome')
    });
  }
}

// index.ts 
// ========
import { LandingController } from './lib/routes/landing';
import { BaseApplicationServer } from 'express-starter-config';

class ApplicationServer extends BaseApplicationServer {
  constructor() {
    super();
    this.addControllers(LandingController);
  }
}

// Start the application
new ApplicationServer().start();

Install

npm install -g typescript
npm install --save express-ts-starter

Scripts

  • npm run readme : node ./node_modules/.bin/node-readme
  • npm run build:minify : node dist/lib/minify.js --css --js --debug
  • npm run build:typescript : tsc
  • npm run build : rm -rf dist && tsc && npm run readme
  • npm run prod : npm run build && node dist/index.js --instance prod
  • npm run dev : npm run build:typescript && node dist/index.js --instance dev --debug
  • npm run test : mocha ./dist/test/*.js
  • npm run watch : nodemon
  • npm run start : node dist/index.js --instance prod

Dependencies

Package Version Dev
@decorators/di ^1.0.2
@decorators/express ^2.3.0
args-finder 0.0.3
commander ^2.19.0
dot-object ^1.7.1
express-starter-config ^0.4.1
great-logs 0.0.4
nodemon ^1.19.1
prompts ^2.0.1
shelljs ^0.8.3
walkdir 0.0.12
@types/chai ^4.1.3
@types/express ^4.16.0
@types/mocha ^5.2.0
@types/node ^10.0.4
chai ^4.1.2
mocha ^5.1.1
node-readme ^0.1.9

Contributing

Please check the Contributing Guidelines for more details. Thanks!

Author

Wendly Saintil

License

MIT

Keywords