improve readme

This commit is contained in:
Philipp Kunz 2016-01-18 15:20:23 +01:00
parent 814542e9cd
commit 20283c6cda
4 changed files with 15 additions and 1 deletions

View File

@ -22,6 +22,17 @@ Then use it in package.json's script section to trigger a build:
by default npmts looks for `./ts/index.ts` and `./ts/test.ts` that will compile to
`./index.js` and `./test.js`
npmts also creates a index.d.ts declaration file.
You can reference it in your package.json like this:
```json
"main": "index.js",
"typings": "./index.d.ts",
```
When requiring the module from other TypeScript files,
the TypeScript Compiler will use the declaration file to resolve typings.
#### Declaration files
### Custom behaviour

View File

@ -3,8 +3,9 @@
"version": "1.0.4",
"description": "write npm modules with TypeScript",
"main": "index.js",
"typings": "./index.d.ts",
"bin": {
"npmts": "index.js"
"npmts": "./index.js"
},
"scripts": {
"test": "(cd compile && node compile.js)",

0
test/index.d.ts vendored Normal file
View File

View File

@ -1,3 +1,5 @@
#!/usr/bin/env node
(function () {
console.log("test");
}());