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

ntypescript

v1.201706190042.1

Published

A nicer version of microsoft/typescript packaged and released for API developers

Downloads

5,511

Readme

NTypeScript is dead. Bring your own TypeScript 🌹

The following is left as legacy docs.

NTypeScript

Downloads BuildStatus

Nicer TypeScript, making it easier to work with the compiler API 🌹

NPM

Kudos to the TypeScript team for maintaining all the code that this project depends on. This project is just a minor automation on top.

Niceness list:

  • Releases everyday.
  • Consistent side by side usage (just add an n prefix): require('ntypescript'), ntsc
  • package.json links you to typescript definitions (using typescript.definition entry)
  • Super Nice: We expose the internal APIs (the ones that have /* internal */)
  • Super Nice: We expose the global ts variable. Just require('ntypescript') once and start using ts like you are in the actual compiler source code.
  • Super Nice: Converts const enum in the compiler definition to enum. This decreases the typescript compiler version dependence on your dev tools TS->JS emit.
  • Easier to muck around with the compiler / language service when installed from NPM. Just open any file from node_modules/ntypescript/src folder in atom-typescript and press f6 to get a new local rebuild.

Design incompatibilities:

  • This project does not ship with tsserver.

Install

Similar to typescript you can install and use ntypescript globally:

npm install ntypescript -g

or in your package.json

npm install ntypescript@latest --save --save-exact

Each release is named after the day it was built and the git commit hash in Microsoft/TypeScript/master that it was built from. We recommend adding save-exact as there are no guarantees on when stuff might break and you want your users to get the same version you tested.

Usage

Globally

You can use ntsc exactly like the tsc command line tool.

Require

Use require('ntypescript')

Global ts

In addition to returning what typescript returns we also expose ts as a global.

declare var require: any;
require('ntypescript');
console.log(ts.createScanner);

Which makes it easy to use the compiler API if you are using it heavily. Note you only need to require once from any file.

Replace TypeScript

For require('typescript') you can do that quite simply using your package.json:

"dependencies": {
    "typescript": "https://github.com/basarat/ntypescript/tarball/<release name>"
}

Release name example : 1.201506301047.1+e1c9d28cb0706f81c14ca95b92fa3e2a223cc60b

Grunt

This project comes with a built in grunt task called ntypescript. Just has just one task level option:

  • project : path to the project directory i.e. the directory that contains tsconfig.json.

Here is a sample Gruntfile.js for usage:

module.exports = function(grunt) {
    grunt.loadNpmTasks('ntypescript');

    grunt.initConfig({
        ntypescript: {
            options: {
                project: '.'
            }
        },
    });

    grunt.registerTask('default', ['ntypescript']);
};

NPM Scripts

Init and setup in package.json

npm init
npm install ntypescript@latest --save --save-exact
"scripts": {
    "build": "ntsc -p ./src"
},

And then you just need to do the following to build your project:

npm run build

About

Note that this is a personal endeavor, not officially by Microsoft.