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

generator-node-express-typescript

Package Overview
Dependencies
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

generator-node-express-typescript

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

  • 4.2.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
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.
  • jest - as testing and coverage framework to write specs in TypeScript itself. You can choose to use mocha or ava instead.

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

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-typescript

You can choose to use mocha as your test framework using command - $yo node-typescript --mocha

You can choose to use ava as your test framework using command - $yo node-typescript --ava

Generate a new class and test file.

$yo node-typescript:classlib MyNewClass [--mocha | --ava]

Highlights of the latest release

  • I use latest version of TypeScript.

  • I use yarn in place of npm if it's available.

  • I use jest which is a "batteries-included" testing framework with coverage built-in (optionally mocha or ava). You write tests in TypeScript itself.

  • I use prettier integrated with tslint to provide no-fuss code formatting and linting.

  • 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 packages.

    Integration with VS Code

  • I configure build, clean, lint, coverage, format and test tasks that you can run using Run Task option.

  • You can directly run currently open source file using task Run current file. I use ts-node to provide this functionality.

  • You can debug currently open source file using Debug file launch configuration. You can also debug currently open test file using Debug test launch configuration without the need of compiling it first. Here is the preview -

    TypeScript debugging in VS Code

License

MIT

Keywords

FAQs

Package last updated on 06 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