test node import
This commit is contained in:
parent
c44d5925a4
commit
015e166076
1
node-importer/import-module/ab.ts
Normal file
1
node-importer/import-module/ab.ts
Normal file
@ -0,0 +1 @@
|
||||
export const add = (a: number, b: number) => a + b;
|
17
node-importer/package.json
Normal file
17
node-importer/package.json
Normal file
@ -0,0 +1,17 @@
|
||||
{
|
||||
"name": "node-importer",
|
||||
"version": "0.0.1",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "abearxiong <xiongxiao@xiongxiao.me> (https://www.xiongxiao.me)",
|
||||
"license": "MIT",
|
||||
"packageManager": "pnpm@10.6.2",
|
||||
"type": "module",
|
||||
"imports": {
|
||||
"#ab": "./import-module/ab.ts"
|
||||
}
|
||||
}
|
3
node-importer/src/index.ts
Normal file
3
node-importer/src/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
import { add } from '#ab';
|
||||
|
||||
console.log(add(1, 2));
|
Loading…
x
Reference in New Issue
Block a user