Skip to content

Commit

Permalink
Rewritten in Typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
dex4er committed May 10, 2019
1 parent d86c977 commit 55b3907
Show file tree
Hide file tree
Showing 31 changed files with 598 additions and 783 deletions.
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
coverage/**
ts-node-*/**
**/*.d.ts
**/*-ts.js
16 changes: 0 additions & 16 deletions .eslintrc.js

This file was deleted.

9 changes: 9 additions & 0 deletions .eslintrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# npm i -g eslint eslint-config-prettier eslint-plugin-import eslint-plugin-node

env:
node: true

extends: prettier

parserOptions:
ecmaVersion: 2017
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
*-ts.js

*.gz
*.lock
*.log
*.out
*.tgz

ts-node-*

/lib/
/test/mocha.opts

/coverage/
/node_modules/
/out/

/.nyc_output/

/.tags
/.tern-project

.DS_Store
/package-lock.json
/yarn.lock
/yarn-error.log

.DS_Store
/.idea
/.vscode
2 changes: 1 addition & 1 deletion .markdownlint.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"default": true
}
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
!/index.js
!/tsconfig.json
!/lib/*
!/src/*
10 changes: 10 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
printWidth: 120
tabWidth: 2
useTabs: false
semi: false
singleQuote: true
quoteProps: as-needed
trailingComma: all
bracketSpacing: false
arrowParens: avoid
endOfLine: lf
23 changes: 13 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@ sudo: false

language: node_js

env:
global:
- TAP_RCFILE=./.taprc

matrix:
include:
- node_js: "node"
env: NPM_RUN_SCRIPT=test
- node_js: "10"
- node_js: "8"
- node_js: "6"
- 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"
- node_js: '10'
- node_js: '8'
- node_js: '6'

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

script:
- npm run ${NPM_RUN_SCRIPT:-test:api}
- 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
- npm run clean
- git add .
- git diff-index --quiet HEAD
39 changes: 22 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,60 @@
# Changelog

## v4.0.0 2019-05-10

- Rewritten in Typescript.
- Dropped support for Node < 6.

## v3.1.1 2018-05-22

* Support `connect(port, host)` method arguments, again.
- Support `connect(port, host)` method arguments, again.

## v3.1.0 2018-05-19

* Support `connect(port, host)` method arguments (not really).
- Support `connect(port, host)` method arguments (not really).

## v3.0.2 2018-03-12

* Use markdownlint.
- Use markdownlint.

## v3.0.1 2018-02-13

* Tweaks for example BSMTP client.
- Tweaks for example BSMTP client.

## v3.0.0 2018-02-05

* New method `destroy`.
* Support for `import PromiseSocket from 'promise-socket'` syntax.
* Upgraded promise-readable@3, promise-writable@3 and promise-duplex@3.
- New method `destroy`.
- Support for `import PromiseSocket from 'promise-socket'` syntax.
- Upgraded promise-readable@3, promise-writable@3 and promise-duplex@3.

## v2.0.2 2017-10-17

* Requires promise-duplex@2.0.3.
- Requires promise-duplex@2.0.3.

## v2.0.1 2017-10-06

* Do not use UMD import internally.
- Do not use UMD import internally.

## v2.0.0 2017-10-06

* Use native `Promise` rather than `any-event`.
- Use native `Promise` rather than `any-event`.

## v1.0.1 2017-10-06

* Typescript: reference additional modules in our typings file.
- Typescript: reference additional modules in our typings file.

## v1.0.0 2017-10-02

* Exports also as a class and namespace and the default.
* Typings for Typescript.
* Based on promise-duplex@1.x.x
- Exports also as a class and namespace and the default.
- Typings for Typescript.
- Based on promise-duplex@1.x.x

## v0.0.2 2017-06-22

* Upgraded chai@4.0.2, chai-as-promised@7.0.0, promise-duplex@0.1.2,
- Upgraded chai@4.0.2, chai-as-promised@7.0.0, promise-duplex@0.1.2,
snazzy@7.0.0, standard@10.0.2, tap@10.5.1, tap-given@0.4.1
* Bugfixes for tests
- Bugfixes for tests

## v0.0.1 2017-03-12

* Initial release
- Initial release
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017-2018 Piotr Roszatycki <piotr.roszatycki@gmail.com>
Copyright (c) 2017-2019 Piotr Roszatycki <piotr.roszatycki@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# promise-socket

<!-- markdownlint-disable MD013 -->

[![Build Status](https://secure.travis-ci.org/dex4er/js-promise-socket.svg)](http://travis-ci.org/dex4er/js-promise-socket) [![Coverage Status](https://coveralls.io/repos/github/dex4er/js-promise-socket/badge.svg)](https://coveralls.io/github/dex4er/js-promise-socket) [![npm](https://img.shields.io/npm/v/promise-socket.svg)](https://www.npmjs.com/package/promise-socket)

<!-- markdownlint-enable MD013 -->

This module allows to convert
Expand Down Expand Up @@ -81,7 +83,10 @@ console.log(promiseSocket.stream.localAddress)
### connect

```js
await connect(port, host)
await connect(
port,
host,
)
await connect(path)
await connect(options)
```
Expand All @@ -94,9 +99,12 @@ arguments.
_Example:_

```js
await connect(80, 'localhost')
await connect(
80,
'localhost',
)
// or
await connect({ port: 80, host: 'localhost'})
await connect({port: 80, host: 'localhost'})
```

### setTimeout
Expand Down
126 changes: 0 additions & 126 deletions examples/bsmtp-client-ts.ts

This file was deleted.

0 comments on commit 55b3907

Please sign in to comment.