Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@opendevstack/generator-node-express-typescript

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@opendevstack/generator-node-express-typescript

A minimal Yeoman Generator for creating NodeJS modules using TypeScript and including a minimal express server.

  • 0.5.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

TypeScript NodeJS Generator

Build Status npm version

This is a fork of this generator but I added express to it.

I'm a minimal Yeoman generator for creating NodeJS express servers using TypeScript. I let you quickly setup a project with latest available tools and best practices.

I use:

  • npm - as task runner. You can choose to use gulp instead.
  • tslint - as linter for TypeScript source files.
  • mocha - as testing framework to write specs in TypeScript itself.
  • istanbul - a JavaScript code coverage tool working on TypeScript files.

I don't use: a UI renderer or anything visual I am a pure API targeted generator. So with me, you should build REST API's.

You want to know if you can change any of these? Of course, why not? It is your module after all. I simply get down to business of generating, no questions asked. Once done, I get out of the way and you can do as you please!

Usage

Install generator-node-express-typescript globally. If you are planning to use gulp, install gulp-cli globally.

$npm install -g generator-node-express-typescript

Create a new directory and cd into it.

$mkdir my-new-project && cd $_

Run the generator.

$yo node-express-typescript

You can choose to use gulp as your build system using command - $yo node-express-typescript --gulp

Run npm run for information on available tasks.

 $npm run
Lifecycle scripts included in node-ts:
  test
    npm run build && mocha --compilers ts:ts-node/register --recursive test/**/*-spec.ts
  coverage
    nyc --reporter=text --reporter=html mocha --compilers ts:ts-node/register

available via `npm run-script`:
  clean
    rimraf lib
  lint
    tslint --format verbose 'src/**/*.ts'
  build
    npm run clean && npm run lint && echo Using TypeScript && tsc --version && tsc --pretty
  coverage
    nyc --reporter=text --reporter=html mocha --compilers ts:ts-node/register
  watch
    npm run build -- --watch
  watch:test
    npm run test -- --watch

If you choose to use gulp, you can find the available tasks using command gulp help.

$gulp help

Usage
  gulp [TASK] [OPTIONS...]

Available tasks
  build  Compiles all TypeScript source files [lint]
  clean  Cleans the generated js files from lib directory
  help   Display this help text.
  lint   Lints all TypeScript source files
  test   Runs the mocha test specs [build]
  watch  Watches ts source files and runs build on change

Highlights of the latest release

  • I use latest version of TypeScript.
  • I use npm to fetch type definitions making life so much easier. You can find more information on https://blogs.msdn.microsoft.com/typescript/2016/06/15/the-future-of-declaration-files/.
  • I use mocha as testing framework as it allows easier test runs from command line. Also, one of the most important things regarding testing is now you can write tests in TypeScript itself. The out-of-box configuration includes use of ts-node as mocha compiler allowing executing specs written in TypeScript without compiling them first.
  • I need no global dependencies. Every dependency such as TypeScript and tslint is installed as local dev dependency allowing you to freely use different versions of these for different modules.
  • I provide test coverage support using istanbul.
  • I provide nice integration with VS Code editor. I configure build, clean, lint, coverage and test tasks that you can run using Run Task option.

License

MIT

Keywords

FAQs

Package last updated on 11 Jul 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc