npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-nts

v0.6.1

Published

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

Downloads

7

Readme

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.
  • 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-nts globally. If you are planning to use gulp, install gulp-cli globally.

$npm install -g generator-nts

Create a new directory and cd into it.

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

Run the generator.

$yo nts

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

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, coverage and test tasks that you can run using Run Task option.

License

MIT