@kokiito0926/hypernode 0.0.5 → 0.0.7
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/README.md +2 -8
- package/example.js +2 -6
- package/{import.js → index.js} +0 -5
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
## ハイパーノード(
|
|
1
|
+
## ハイパーノード(hypernode)
|
|
2
2
|
|
|
3
|
-
ハイパーノード(
|
|
3
|
+
ハイパーノード(hypernode)は、Node.jsのカスタムローダーです。
|
|
4
4
|
HTTPS([esm.sh](https://esm.sh/)など)で公開されている、ESMのモジュールを直接的にimportをすることができるようになります。
|
|
5
5
|
[zx](https://github.com/google/zx)と組み合わせたりして、短いスクリプトを書いたりするときに便利かもしれません。
|
|
6
6
|
|
|
@@ -26,12 +26,6 @@ console.log(axios?.get);
|
|
|
26
26
|
console.log(chunk([1, 2, 3, 4, 5, 6], 2));
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
## 未分類
|
|
30
|
-
|
|
31
|
-
```bash
|
|
32
|
-
$ node ./import.js ./example.js --message "Hello world!"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
29
|
## ライセンス
|
|
36
30
|
|
|
37
31
|
[MIT](LICENSE)
|
package/example.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
// >> $ node ./
|
|
4
|
-
|
|
5
|
-
// import { argv } from "zx";
|
|
6
|
-
import { $, argv, minimist } from "https://esm.sh/zx";
|
|
3
|
+
// >> $ node ./index.js ./example.js --message "Hello world!"
|
|
7
4
|
|
|
8
5
|
import axios from "https://esm.sh/axios";
|
|
9
6
|
import { chunk } from "https://esm.sh/lodash";
|
|
10
|
-
|
|
11
|
-
// console.log("Hello world!");
|
|
7
|
+
import { $, argv, minimist } from "https://esm.sh/zx";
|
|
12
8
|
|
|
13
9
|
console.log($);
|
|
14
10
|
|
package/{import.js → index.js}
RENAMED
|
@@ -7,18 +7,13 @@ import { pathToFileURL } from "node:url";
|
|
|
7
7
|
|
|
8
8
|
register("./hook.js", import.meta.url);
|
|
9
9
|
|
|
10
|
-
// console.log(argv);
|
|
11
|
-
|
|
12
10
|
if (!argv._[0]) {
|
|
13
11
|
process.exit(1);
|
|
14
12
|
}
|
|
15
13
|
|
|
16
14
|
const targetPath = path.resolve(process.cwd(), argv._[0]);
|
|
17
|
-
// const targetPath = path.resolve(process.cwd(), argv._[1]);
|
|
18
|
-
|
|
19
15
|
if (!fs.existsSync(targetPath)) {
|
|
20
16
|
process.exit(1);
|
|
21
17
|
}
|
|
22
18
|
|
|
23
19
|
await import(pathToFileURL(targetPath).href);
|
|
24
|
-
// await import(argv._[1]);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kokiito0926/hypernode",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"private": false,
|
|
5
|
-
"description": "ハイパーノード(
|
|
5
|
+
"description": "ハイパーノード(hypernode)を用いると、importにHTTPSを指定することができるようになります。",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"cli",
|
|
8
8
|
"bash",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"access": "public"
|
|
17
17
|
},
|
|
18
18
|
"bin": {
|
|
19
|
-
"hypernode": "
|
|
19
|
+
"hypernode": "index.js"
|
|
20
20
|
},
|
|
21
21
|
"bugs": {
|
|
22
22
|
"url": "https://github.com/kokiito0926/hypernode/issues"
|