Skip to content

Commit e2ce1f6

Browse files
authored
Merge pull request #80 from yibn2008/feat/upgrade-ts
feat: upgrade to TS version
2 parents 086d221 + 8365733 commit e2ce1f6

25 files changed

+608
-303
lines changed

.github/workflows/nodejs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@ jobs:
1717
# Operating System Matrix
1818
# ubuntu-latest: Latest Ubuntu version (currently 22.04)
1919
# windows-latest: Latest Windows Server version (currently 2022)
20-
# macos-12: macOS 12 Monterey (released 2021)
2120
# macos-13: macOS 13 Ventura (released 2022)
2221
# macos-14: macOS 14 Sonoma (released 2023)
2322
# macos-15: macOS 15 Sequoia (released 2024)
24-
os: [ubuntu-latest, windows-latest, macos-12, macos-13, macos-14, macos-15]
23+
os: [ubuntu-latest, windows-latest, macos-13, macos-14, macos-15]
2524
# Node.js Version Matrix
2625
# 16: Node.js 16.x LTS (released 2020, EOL April 2024)
2726
# 18: Node.js 18.x LTS (released 2022, EOL April 2025)
@@ -36,4 +35,5 @@ jobs:
3635
node-version: ${{ matrix.node }}
3736
- run: npm install
3837
- run: npm run build --if-present
38+
- run: chmod +x dist/bin/*.js || true
3939
- run: npm test

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,5 @@ node_modules
3636

3737
.justconf
3838

39-
.vscode
39+
.vscode
40+
/dist

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
*.log
2+
src/
23
test/
34
docs/
45
example/
@@ -14,3 +15,4 @@ workbench/
1415

1516

1617
.justconf
18+

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,5 @@
139139
==================
140140

141141
* Initial version, support find process by port/pid/name
142+
143+
## 2.0.0 (2025-07-05)

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ $ npm install find-process --save
5757

5858
Usage:
5959

60-
```javascript
61-
const find = require('find-process');
60+
```js
61+
import find from "find-process";
6262

6363
find('pid', 12345)
6464
.then(function (list) {

index.d.ts

Lines changed: 0 additions & 35 deletions
This file was deleted.

lib/logger.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

package.json

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,22 @@
11
{
22
"name": "find-process",
3-
"version": "1.4.11",
3+
"version": "2.0.0",
44
"description": "find process info by port/pid/name etc.",
5-
"main": "index.js",
6-
"types": "index.d.ts",
5+
"main": "dist/index.js",
6+
"types": "dist/index.d.ts",
77
"scripts": {
8-
"test": "mocha test/*.test.js && standard",
9-
"lint": "standard --fix && npm-ensure -t deps"
8+
"build": "tsc && node scripts/postbuild.js",
9+
"dev": "tsc --watch",
10+
"test": "npm run build && mocha -r ts-node/register test/*.test.ts && standard",
11+
"lint": "standard --fix && npm-ensure -t deps",
12+
"type-check": "tsc --noEmit",
13+
"check-version": "node scripts/check-version.js",
14+
"update-history": "node scripts/update-history.js",
15+
"prepublishOnly": "npm run build && npm run check-version",
16+
"prepare": "npm run build"
1017
},
1118
"bin": {
12-
"find-process": "bin/find-process.js"
19+
"find-process": "dist/bin/find-process.js"
1320
},
1421
"ensure": {
1522
"deps": {
@@ -42,6 +49,7 @@
4249
"/doc",
4350
"/example",
4451
"/test",
52+
"/dist",
4553
"index.d.ts"
4654
]
4755
},
@@ -57,12 +65,16 @@
5765
"loglevel": "^1.9.2"
5866
},
5967
"devDependencies": {
68+
"@types/mocha": "^10.0.10",
69+
"@types/node": "^24.0.10",
70+
"eslint": "^9.17.0",
71+
"glob": "^11.0.0",
6072
"mocha": "^11.0.1",
6173
"npm-ensure": "^1.3.0",
74+
"rimraf": "^6.0.1",
6275
"standard": "^17.1.2",
63-
"eslint": "^9.17.0",
64-
"glob": "^11.0.0",
65-
"rimraf": "^6.0.1"
76+
"ts-node": "^10.9.2",
77+
"typescript": "^5.8.3"
6678
},
6779
"publishConfig": {
6880
"registry": "https://registry.npmjs.org"

0 commit comments

Comments
 (0)