{"_id":"@acepad/here","name":"@acepad/here","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@acepad/here","scripts":{"test":"run test/test-here.js"},"description":"Resolve file from import.meta.url in acepad/petit-node.","main":"here.js","version":"1.0.0","type":"module","dependencies":{"petit-node":"^1.0.0"},"gitHead":"39cebaeaf391a82302c31b651e0ea942ed32c382","_id":"@acepad/here@1.0.0","_nodeVersion":"22.17.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-1+6OswNPOL/UnHz3QeE6tua1Y8i/6wPok11OYs6xQkT07hZPo7WcrhL2LOGmWzkwkU2VUvU0fKSVPh1vu3jvSA==","shasum":"e602e30d8b9510f699930e3f5dd4827e922dd968","tarball":"https://registry.npmjs.org/@acepad/here/-/here-1.0.0.tgz","fileCount":4,"unpackedSize":2932,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIHVtREyC0W62z07qYgVe2ptBxw4kTwYjKfT0eGLjuKlGAiATLOie+6W5fVj2CoFNTX0hqW9abUMBqxtU+EIxIyWnPQ=="}]},"_npmUser":{"name":"acepad","email":"pnode.acepad@gmail.com"},"directories":{},"maintainers":[{"name":"acepad","email":"pnode.acepad@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/here_1.0.0_1769235253067_0.12662201305587883"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-24T06:14:12.952Z","1.0.0":"2026-01-24T06:14:13.212Z","modified":"2026-01-24T06:14:13.435Z"},"maintainers":[{"name":"acepad","email":"pnode.acepad@gmail.com"}],"description":"Resolve file from import.meta.url in acepad/petit-node.","readme":"NOTE: This package is supporsed to work in [acepad](https://github.com/hoge1e3/acepad-dev), not a regular node envronment.\n\n# @acepad/here\n\nResolve `import.meta.url` in [acepad](https://github.com/hoge1e3/acepad-dev/blob/main/README.md)/[petit-node](https://github.com/hoge1e3/petit-node). \n\npetit-node provides modules via BlobURL, @acepad/here determines original file from the BlobURL.\n\n## functions\n\n- `filePath`(`bloburl`:string)\n   - Get file path correspond to `bloburl`. \n   - `bloburl` normally should be `import.meta.url`\n- `dirPath`(`bloburl`:string)\n   - Get directory path that points parent directory of `filePath`(`bloburl`)\n- `siblingPath`(`bloburl`:string, `relative_path`:string)\n   - Get file path that points `relative_path` from `dirPath`(`bloburl`)\n- `file`(`bloburl`:string)\n   - Get [File object](https://github.com/hoge1e3/sfile?tab=readme-ov-file#quick-reference-of-file-object) correspond to `bloburl`. \n   - `bloburl` normally should be `import.meta.url`\n- `dir`(`bloburl`:string)\n   - Get [File object](https://github.com/hoge1e3/sfile?tab=readme-ov-file#quick-reference-of-file-object) that points parent directory of `file`(`bloburl`)\n- `sibling`(`bloburl`:string, `relative_path`:string)\n   - Get [File object](https://github.com/hoge1e3/sfile?tab=readme-ov-file#quick-reference-of-file-object) that points `relative_path` from `dir`(`bloburl`)\n\n## (a stupid:-) Example\n\n- Launch [acepad](https://github.com/hoge1e3/acepad-dev/blob/main/README.md).\n- Press F2 (create new script)\n- Type below, and press F5.\n~~~js\n#!run\nimport {file} from \"@acepad/here\";\nexport function main(){\n  // get File object for this file itself.\n  const f=file(import.meta.url);\n  let x=0;// increases by pressing F5\n  const text_content=f.text();\n  const new_content=text_content.replace(/x=\\d+/,`x=${x+1}`);\n  f.text(new_content);\n}\n~~~","readmeFilename":"README.md","_rev":"1-c362fce9ff5201b504c61cacee07d43c"}