fast-process-list 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 fast-process-list contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,54 @@
1
- # Temporary Holding Version
1
+ # fast-process-list
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ A tiny Windows Node-API addon for listing process executable paths.
4
+
5
+ ```js
6
+ import { getProcessPaths } from 'fast-process-list'
7
+
8
+ const paths = getProcessPaths()
9
+ // ['C:\\Windows\\explorer.exe', 'C:\\Program Files\\Microsoft VS Code\\Code.exe', ...]
10
+ ```
11
+
12
+ ## API
13
+
14
+ `getProcessPaths(): string[]`
15
+
16
+ Returns full Win32 executable paths for processes accessible to the current user.
17
+ Unicode characters and spaces are preserved. Multiple processes using the same
18
+ executable produce duplicate paths. Ordering is unspecified.
19
+
20
+ Processes that exit or cannot be opened or queried are skipped. A process can
21
+ also exit immediately after its path is read. Snapshot creation, enumeration, or
22
+ buffer allocation failures throw an `Error` with code `ERR_WINDOWS_PROCESS_LIST`.
23
+
24
+ Image paths and enumeration order can differ from PowerShell/CIM's
25
+ `ExecutablePath` values, for example for executable aliases or renamed images.
26
+
27
+ ## Platform support
28
+
29
+ Windows x64 and ARM64 with Node.js 20+.
30
+
31
+ ## Development
32
+
33
+ ```sh
34
+ pnpm install --frozen-lockfile
35
+ pnpm run build
36
+ pnpm test
37
+ pnpm run check
38
+ pnpm run lint
39
+ pnpm run format
40
+ ```
41
+
42
+ ## Releases
43
+
44
+ From a clean checkout on `main`:
45
+
46
+ ```sh
47
+ git pull --ff-only
48
+ pnpm version patch -m "release: v%s"
49
+ git push origin main --follow-tags
50
+ ```
51
+
52
+ ## License
53
+
54
+ MIT.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Lists accessible Windows process executable paths without spawning a subprocess.
3
+ *
4
+ * Paths retain Unicode characters and may repeat when multiple processes use the
5
+ * same executable. Ordering is unspecified. Processes that exit or cannot be
6
+ * queried are skipped; a process may also exit immediately after being queried.
7
+ *
8
+ * @throws {Error} If the process snapshot or path buffer cannot be created, or
9
+ * enumerating the snapshot fails.
10
+ */
11
+ export declare function getProcessPaths(): string[];
package/dist/index.js ADDED
@@ -0,0 +1,25 @@
1
+ import { createRequire } from "node:module";
2
+ // index.ts
3
+ if (process.platform !== "win32" || !["x64", "arm64"].includes(process.arch)) throw new Error(`fast-process-list supports Windows x64 and ARM64; received ${process.platform}/${process.arch}`);
4
+ const require = createRequire(import.meta.url);
5
+ const filename = `../native/fast-process-list.win32-${process.arch}.node`;
6
+ let binding;
7
+ try {
8
+ binding = require(filename);
9
+ } catch (cause) {
10
+ throw new Error(`Cannot load ${filename}. When using a source checkout, run pnpm run build with Rust and the MSVC build tools installed.`, { cause });
11
+ }
12
+ /**
13
+ * Lists accessible Windows process executable paths without spawning a subprocess.
14
+ *
15
+ * Paths retain Unicode characters and may repeat when multiple processes use the
16
+ * same executable. Ordering is unspecified. Processes that exit or cannot be
17
+ * queried are skipped; a process may also exit immediately after being queried.
18
+ *
19
+ * @throws {Error} If the process snapshot or path buffer cannot be created, or
20
+ * enumerating the snapshot fails.
21
+ */
22
+ function getProcessPaths() {
23
+ return binding.getProcessPaths();
24
+ }
25
+ export { getProcessPaths };
package/package.json CHANGED
@@ -1,6 +1,51 @@
1
1
  {
2
2
  "name": "fast-process-list",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.1.0",
4
+ "description": "Tiny native addon for listing Windows process executable paths",
5
+ "keywords": [
6
+ "napi",
7
+ "node-api",
8
+ "process",
9
+ "process-list",
10
+ "windows"
11
+ ],
12
+ "homepage": "https://github.com/sapphi-red/fast-process-list#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/sapphi-red/fast-process-list/issues"
15
+ },
16
+ "license": "MIT",
17
+ "files": [
18
+ "dist",
19
+ "native/*.node"
20
+ ],
21
+ "os": [
22
+ "win32"
23
+ ],
24
+ "cpu": [
25
+ "x64",
26
+ "arm64"
27
+ ],
28
+ "type": "module",
29
+ "exports": "./dist/index.js",
30
+ "devDependencies": {
31
+ "@types/node": "^26.6.6",
32
+ "oxfmt": "^0.78.0",
33
+ "oxlint": "^1.93.0",
34
+ "oxlint-tsgolint": "^7.0.2006",
35
+ "tsdown": "^0.23.7",
36
+ "typescript": "^7.0.2",
37
+ "vitest": "^4.1.12"
38
+ },
39
+ "engines": {
40
+ "node": ">=20"
41
+ },
42
+ "scripts": {
43
+ "build": "tsdown",
44
+ "build:js": "tsdown --on-success \"\"",
45
+ "test": "pnpm run build && vitest run",
46
+ "check": "pnpm run format:check && pnpm run lint && cargo fmt --check && cargo clippy --lib --locked -- -D warnings",
47
+ "lint": "oxlint",
48
+ "format": "oxfmt",
49
+ "format:check": "oxfmt --check"
50
+ }
6
51
  }