improve readme
This commit is contained in:
parent
814542e9cd
commit
20283c6cda
11
README.md
11
README.md
@ -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
|
||||
|
@ -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
0
test/index.d.ts
vendored
Normal file
@ -1,3 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
(function () {
|
||||
console.log("test");
|
||||
}());
|
||||
|
Loading…
Reference in New Issue
Block a user