Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed Jun 4, 2019
1 parent 8c8e6d0 commit b479386
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 41 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
*-ts.js

*.d.ts
*.gz
*.lock
*.log
*.map
*.out
*.tgz

ts-node-*
Expand Down
8 changes: 8 additions & 0 deletions .nycrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"all": true,
"cache": false,
"extension": [".ts"],
"exclude": ["**/*.d.ts", "examples/**"],
"include": ["**/*.ts"],
"sourceMap": true
}
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,21 @@ language: node_js
matrix:
include:
- node_js: "node"
env: NPM_RUN_SCRIPT=test NPM_AUDIT=true MOCHA_ARGS="-- --node-arg=--pending-deprecation --node-arg=--throw-deprecation" NYC="nyc --reporter json"
env: NPM_PACK=yes NPM_AUDIT=yes NYC="nyc --no-clean --reporter=lcov"
- node_js: "10"
- node_js: "8"
- node_js: "6"

install:
- set -e
- npm install
- if [ "$NPM_AUDIT" = true ]; then npm audit; fi
- if [ -n "$NPM_AUDIT" ]; then npm audit; fi

script:
- echo "--reporter dot --color" > test/mocha.opts
- npm run build
- $NYC npm run ${NPM_RUN_SCRIPT:-test:spec} -- ${MOCHA_ARGS}
- if [ -n "$NYC" ]; then nyc report --color && nyc report --reporter=text-lcov | coveralls; fi
- if [ -n "$NPM_PACK" ]; then npm pack; fi
- npm run test:spec
- if [ -n "$NYC" ]; then npx nyc report --color && npx nyc report --reporter=text-lcov | npx coveralls; fi
- git diff --stat --exit-code
- for f in $(git ls-files --others --exclude-standard); do git diff --no-index --stat --exit-code /dev/null $next; done
- npm run clean
- git add .
- git diff-index --quiet HEAD
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v3.0.1 2019-06-04

- Minor tweaks in README.
- Added source map to the package.

## v3.0.0 2019-05-08

- Typings compatible with Node v12.
Expand Down
18 changes: 2 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ _Additionally for Typescript:_
npm install -D @types/node
```

Transpiling this module with own settings in `tsconfig.json`:

```json
{
"compilerOptions": {
"baseUrl": ".",
"esModuleInterop": true,
"paths": {
"dgram-as-promised": ["node_modules/dgram-as-promised/src/dgram-as-promised"]
},
"strict": true
},
"include": ["*.ts", "node_modules/dgram-as-promised/src/*.ts"]
}
```

## Usage

`dgram-as-promised` can be used similar to standard `dgram` module.
Expand All @@ -66,6 +50,8 @@ _Typescript:_

```ts
import DgramAsPromised from "dgram-as-promised"
// or
import {DgramAsPromised} from "dgram-as-promised"

const socket = DgramAsPromised.createSocket("udp4")
```
Expand Down
28 changes: 11 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dgram-as-promised",
"version": "3.0.0",
"version": "3.0.1",
"description": "Promisify dgram module",
"main": "lib/dgram-as-promised.js",
"typings": "lib/dgram-as-promised.d.ts",
Expand Down Expand Up @@ -48,24 +48,18 @@
"typescript": "^3.4.5"
},
"scripts": {
"build": "npm run compile",
"clean": "shx rm -rf lib",
"compile": "tsc --pretty",
"compile": "tsc --pretty --project .",
"clean": "npm run clean:compile && npm run clean:coverage",
"clean:compile": "shx rm -rf lib",
"clean:coverage": "shx rm -rf coverage .nyc_output",
"lint": "npm run compile && tsc --pretty -p examples && tsc --pretty -p test && eslint . && tslint -t stylish -p . && tslint -t stylish -p examples && tslint -t stylish -p test && prettier --ignore-path .gitignore --list-different '**/*.{js,json,md,ts,yml}' && markdownlint \"*.md\"",
"postpublish": "git tag v$npm_package_version -a -m \"Release v$npm_package_version\" && git push --tags",
"prepublishOnly": "npm run build",
"pretest": "npm run build && tsc --pretty -p examples && tsc --pretty -p test && eslint . && tslint -t stylish -p . && tslint -t stylish -p examples && tslint -t stylish -p test && prettier --ignore-path .gitignore --list-different '**/*.js' '**/*.json' '**/*.ts' '**/*.yml' && markdownlint \"*.md\"",
"prepack": "npm run compile",
"prepublishOnly": "npm run test",
"pretest": "npm run lint",
"test": "npm run test:spec",
"test:spec": "npm run ts-mocha -- \"test/*.ts\"",
"test:coverage": "nyc --reporter json npm run test:spec && nyc report",
"ts-mocha": "mocha --use_strict --throw-deprecation --require source-map-support/register --require ts-node/register --timeout 90000"
},
"nyc": {
"extension": [
".ts"
],
"exclude": [
".*.js",
"**/*.d.ts"
]
"test:coverage": "npm run clean:coverage && cross-env NYC=\"nyc --no-clean --reporter=lcov\" npm run test:spec && nyc report --reporter=text-summary --color",
"ts-mocha": "$NYC mocha --use_strict --throw-deprecation --require source-map-support/register --require ts-node/register --timeout 90000"
}
}
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"noUnusedLocals": true,
"noUnusedParameters": true,
"outDir": "./lib",
"target": "es6",
"sourceMap": true,
"strict": true,
"target": "es6",
"typeRoots": ["node_modules/@types"]
},
"exclude": ["./examples/**/*", "./lib/**/*", "./test/**/*"]
Expand Down

0 comments on commit b479386

Please sign in to comment.