Skip to content

Commit

Permalink
refactor: migrate library to TypeScript (#40)
Browse files Browse the repository at this point in the history
* Initial work

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better match pattern

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Starting to figure things out

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Update docs

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Create prepublish script

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Better import/export

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>

* Fix tests

Signed-off-by: Josh-Cena <sidachen2003@gmail.com>
  • Loading branch information
Josh-Cena authored Sep 10, 2021
1 parent b814bb1 commit 8f95bbb
Show file tree
Hide file tree
Showing 18 changed files with 2,145 additions and 2,068 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
26 changes: 23 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
{
"extends": "ngryman",
"root": true,
"extends": [
"ngryman",
"eslint:recommended",
"plugin:@typescript-eslint/recommended"
],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"rules": {
"valid-jsdoc": "off"
}
"prefer-const": "warn",
"no-var": "error"
},
"overrides": [
{
"files": ["test/*"],
"globals": {
"describe": true,
"it": true
},
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
]
}
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,7 @@ jobs:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm install
- name: Build package
run: npm run build
- name: Test
run: npm test
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ Desktop.ini
._*
Thumbs.db
.Spotlight-V100
.Trashes
.Trashes

dist/
.eslintcache
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,11 @@ const stats = readingTime(text);
### Stream

```javascript
const {readingTimeStream} = require('reading-time');
const {ReadingTimeStream} = require('reading-time');

const analyzer = new ReadingTimeStream();
fs.createReadStream('foo')
.pipe(readingTimeStream)
.pipe(analyzer)
.on('data', stats => {
// ...
});
Expand Down
2 changes: 0 additions & 2 deletions index.js

This file was deleted.

72 changes: 0 additions & 72 deletions lib/stream.js

This file was deleted.

Loading

0 comments on commit 8f95bbb

Please sign in to comment.