Code Monkey home page Code Monkey logo

ntypescript's Introduction

NTypeScript

BuildStatus

Not an official build of TypeScript.

Niceties:

  • Consistent side by side usage (just add an n prefix): require('ntypescript'), ntsc, ntsserver
  • package.json links you to typescript definitions (using typescript.definition entry)
  • We expose the internal APIs (the ones that have /* internal */)
  • We expose the global ts variable. Just require('ntypescript') once and start using ts like you are in the actual compiler source code.
  • More frequent releases

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 and the ntsserver command line tools.

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']);
};

About

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

ntypescript's People

Contributors

basarat avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.