@nubjs/nub 0.0.41 → 0.0.44
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 +21 -0
- package/README.md +60 -0
- package/package.json +29 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 nub 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
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# Nub
|
|
2
|
+
|
|
3
|
+
TypeScript-first developer supertool for Node.js. Run `.ts`/`.tsx` files directly on your installed Node, a faster `npm run`, a pnpm-compatible package manager, and a built-in Node version manager — no config, no lock-in, no nub-specific public APIs.
|
|
4
|
+
|
|
5
|
+
**Documentation:** https://nubjs.com/docs
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
# macOS / Linux
|
|
11
|
+
curl -fsSL https://nubjs.com/install.sh | bash
|
|
12
|
+
|
|
13
|
+
# Windows (PowerShell)
|
|
14
|
+
irm https://nubjs.com/install.ps1 | iex
|
|
15
|
+
|
|
16
|
+
# Or via npm
|
|
17
|
+
npm install -g @nubjs/nub
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Quickstart
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
# Run TypeScript directly — no tsconfig, no build step
|
|
24
|
+
nub server.ts
|
|
25
|
+
|
|
26
|
+
# Run package.json scripts (faster than npm/pnpm run)
|
|
27
|
+
nub run dev
|
|
28
|
+
nub run build
|
|
29
|
+
|
|
30
|
+
# Execute a local or remote binary
|
|
31
|
+
nubx vitest --run
|
|
32
|
+
|
|
33
|
+
# Watch mode — restart on change
|
|
34
|
+
nub watch server.ts
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## What Nub does
|
|
38
|
+
|
|
39
|
+
- **TypeScript just works.** Files ending in `.ts`, `.tsx`, `.mts`, `.cts`, `.jsx` execute directly. Enums, decorators, parameter properties, and namespaces are handled. Source maps work in error traces.
|
|
40
|
+
- **The `.env` loading is built in.** Workspace-aware, with `${VAR}` expansion and `.env.local` / `.env.production` layering.
|
|
41
|
+
- **The script runner is faster.** Running `nub run` resolves scripts, adds `node_modules/.bin` to PATH, and runs lifecycle hooks — without the per-invocation Node bootstrap that `npm run` / `pnpm run` pay.
|
|
42
|
+
- **Auto-flag injection.** Experimental Node features are unflagged based on your Node version; opt out with `--no-experimental-*`.
|
|
43
|
+
- **The tsconfig paths resolve.** A path like `@lib/utils` resolves via `compilerOptions.paths` with no build step. Extensionless and data-format imports (`.jsonc`, `.json5`, `.toml`, `.yaml`) work too.
|
|
44
|
+
- **Polyfills.** `Temporal`, `URLPattern`, `RegExp.escape`, `Error.isError`, `Promise.try`, `navigator` — feature-detected, native wins.
|
|
45
|
+
- **Package management.** Commands such as `nub install` / `add` / `remove` are pnpm-compatible on the CLI and lockfile-compatible with whatever the project already uses (npm / pnpm / bun round-trip, yarn read-only) — Nub does not impose its own lockfile format.
|
|
46
|
+
- **Node version management.** Nub provisions and pins the project's Node version, so `nvm` / `corepack` are not needed.
|
|
47
|
+
|
|
48
|
+
## How it works
|
|
49
|
+
|
|
50
|
+
Nub is not a Node fork. It is a Rust CLI that orchestrates your installed Node via Node's own extension surfaces — `module.registerHooks()`, `--import` preloads, V8 flag injection, an N-API addon for fast transpilation, and a per-invocation PATH shim. Code targeting Node runs on Nub byte-for-byte. For orchestration without augmentation, use `nub run --node`.
|
|
51
|
+
|
|
52
|
+
There are no nub-specific public APIs to import, no `nub:*` module namespace, and no config field you author named after the tool. Adopting Nub is reversible — the project keeps running under plain Node and your existing package manager.
|
|
53
|
+
|
|
54
|
+
## Requirements
|
|
55
|
+
|
|
56
|
+
Nub runs on your installed Node, version **18.19.0 or newer**. The fast tier (sync `module.registerHooks()`) engages on Node **22.15+**; versions 18.19–22.14 run in a compatibility tier via async `module.register()`. Supported platforms: macOS (arm64, x64), Linux (x64, arm64), Windows (x64).
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT — see [LICENSE](./LICENSE). Full docs at https://nubjs.com/docs.
|
package/package.json
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nubjs/nub",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.44",
|
|
4
4
|
"description": "TypeScript-first developer supertool — a fast script runner and TS runtime powered by Node.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": "https://github.com/nubjs/nub",
|
|
7
|
-
"homepage": "https://
|
|
7
|
+
"homepage": "https://nubjs.com",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://github.com/nubjs/nub/issues"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"typescript",
|
|
13
|
+
"nodejs",
|
|
14
|
+
"runtime",
|
|
15
|
+
"ts-node",
|
|
16
|
+
"tsx",
|
|
17
|
+
"script-runner",
|
|
18
|
+
"package-manager",
|
|
19
|
+
"node-version-manager"
|
|
20
|
+
],
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=18.19.0"
|
|
23
|
+
},
|
|
8
24
|
"bin": {
|
|
9
25
|
"nub": "bin/nub",
|
|
10
26
|
"nubx": "bin/nubx"
|
|
@@ -15,16 +31,18 @@
|
|
|
15
31
|
"files": [
|
|
16
32
|
"bin",
|
|
17
33
|
"platform.js",
|
|
18
|
-
"postinstall.js"
|
|
34
|
+
"postinstall.js",
|
|
35
|
+
"README.md",
|
|
36
|
+
"LICENSE"
|
|
19
37
|
],
|
|
20
38
|
"optionalDependencies": {
|
|
21
|
-
"@nubjs/nub-darwin-arm64": "0.0.
|
|
22
|
-
"@nubjs/nub-darwin-x64": "0.0.
|
|
23
|
-
"@nubjs/nub-linux-x64": "0.0.
|
|
24
|
-
"@nubjs/nub-linux-x64-musl": "0.0.
|
|
25
|
-
"@nubjs/nub-linux-arm64": "0.0.
|
|
26
|
-
"@nubjs/nub-linux-arm64-musl": "0.0.
|
|
27
|
-
"@nubjs/nub-win32-x64": "0.0.
|
|
28
|
-
"@nubjs/nub-win32-arm64": "0.0.
|
|
39
|
+
"@nubjs/nub-darwin-arm64": "0.0.44",
|
|
40
|
+
"@nubjs/nub-darwin-x64": "0.0.44",
|
|
41
|
+
"@nubjs/nub-linux-x64": "0.0.44",
|
|
42
|
+
"@nubjs/nub-linux-x64-musl": "0.0.44",
|
|
43
|
+
"@nubjs/nub-linux-arm64": "0.0.44",
|
|
44
|
+
"@nubjs/nub-linux-arm64-musl": "0.0.44",
|
|
45
|
+
"@nubjs/nub-win32-x64": "0.0.44",
|
|
46
|
+
"@nubjs/nub-win32-arm64": "0.0.44"
|
|
29
47
|
}
|
|
30
48
|
}
|