{"id":13483723,"url":"https://github.com/TypeStrong/ntypescript","last_synced_at":"2025-03-27T15:30:31.503Z","repository":{"id":34033402,"uuid":"37793170","full_name":"TypeStrong/ntypescript","owner":"TypeStrong","description":"Nicer TypeScript for API devs","archived":false,"fork":false,"pushed_at":"2017-06-19T00:42:45.000Z","size":35492,"stargazers_count":116,"open_issues_count":3,"forks_count":20,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-03-13T13:40:15.034Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ntypescript","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TypeStrong.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-21T02:05:40.000Z","updated_at":"2024-03-01T15:52:39.000Z","dependencies_parsed_at":"2022-07-14T03:00:33.066Z","dependency_job_id":null,"html_url":"https://github.com/TypeStrong/ntypescript","commit_stats":null,"previous_names":["basarat/ntypescript"],"tags_count":494,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeStrong%2Fntypescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeStrong%2Fntypescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeStrong%2Fntypescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TypeStrong%2Fntypescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TypeStrong","download_url":"https://codeload.github.com/TypeStrong/ntypescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245871682,"owners_count":20686246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T17:01:14.604Z","updated_at":"2025-03-27T15:30:29.975Z","avatar_url":"https://github.com/TypeStrong.png","language":"JavaScript","readme":"# NTypeScript is dead. [Bring your own TypeScript](https://github.com/basarat/byots) 🌹\n\nThe following is left as legacy docs.\n\n# NTypeScript\n\n[![Downloads](http://img.shields.io/npm/dm/ntypescript.svg)](https://npmjs.org/package/ntypescript)\n[![BuildStatus](https://travis-ci.org/TypeStrong/ntypescript.svg)](https://travis-ci.org/TypeStrong/ntypescript)\n\n**Nicer** [**TypeScript**](https://github.com/Microsoft/TypeScript), **making it easier to work with the compiler API** 🌹\n\n[![NPM](https://nodei.co/npm-dl/ntypescript.png)](https://nodei.co/npm/ntypescript/)\n\n\u003e Kudos to the TypeScript team for maintaining all the code that this project depends on. This project is just a minor automation on top.\n\nNiceness list:\n\n* Releases everyday.\n* Consistent side by side usage (just add an `n` prefix): `require('ntypescript')`, `ntsc`\n* `package.json` links you to typescript definitions (using `typescript.definition` entry)\n* Super Nice: We expose the internal APIs (the ones that have `/* internal */`)\n* 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.\n* Super Nice: Converts `const enum` in the compiler definition to `enum`. This decreases the typescript compiler version dependence on your dev tools TS-\u003eJS emit.\n* 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.\n\nDesign incompatibilities:\n* This project does not ship with `tsserver`.\n\n## Install\nSimilar to `typescript` you can install and use `ntypescript` globally:\n\n``` sh\nnpm install ntypescript -g\n```\n\nor in your package.json\n\n```sh\nnpm install ntypescript@latest --save --save-exact\n```\n\nEach 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.\n\n## Usage\n\n### Globally\nYou can use `ntsc` *exactly* like the `tsc` command line tool.\n\n### Require\nUse `require('ntypescript')`\n\n### Global `ts`\nIn addition to returning what `typescript` returns we also expose `ts` as a global.\n\n```ts\ndeclare var require: any;\nrequire('ntypescript');\nconsole.log(ts.createScanner);\n```\nWhich makes it easy to use the compiler API if you are using it heavily. Note you only need to `require` *once* from any file.\n\n### Replace TypeScript\nFor `require('typescript')` you can do that quite simply using your package.json:\n\n```json\n\"dependencies\": {\n    \"typescript\": \"https://github.com/basarat/ntypescript/tarball/\u003crelease name\u003e\"\n}\n```\nRelease name example : `1.201506301047.1+e1c9d28cb0706f81c14ca95b92fa3e2a223cc60b`\n\n### Grunt\nThis project comes with a built in `grunt` task called `ntypescript`. Just has just one *task* level option:\n\n* `project` : path to the project directory i.e. the *directory* that contains `tsconfig.json`.\n\nHere is a sample `Gruntfile.js` for usage:\n\n```ts\nmodule.exports = function(grunt) {\n    grunt.loadNpmTasks('ntypescript');\n\n    grunt.initConfig({\n        ntypescript: {\n            options: {\n                project: '.'\n            }\n        },\n    });\n\n    grunt.registerTask('default', ['ntypescript']);\n};\n```\n\n### NPM Scripts\nInit and setup in `package.json`\n```bash\nnpm init\nnpm install ntypescript@latest --save --save-exact\n```\n```json\n\"scripts\": {\n    \"build\": \"ntsc -p ./src\"\n},\n```\nAnd then you just need to do the following to build your project:\n```bash\nnpm run build\n```\n\n# About\nNote that this is a personal endeavor, not officially by Microsoft.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTypeStrong%2Fntypescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTypeStrong%2Fntypescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTypeStrong%2Fntypescript/lists"}