@nshiab/setup-data-project 1.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/LICENSE +21 -0
- package/README.md +25 -0
- package/esm/_dnt.shims.d.ts +6 -0
- package/esm/_dnt.shims.d.ts.map +1 -0
- package/esm/_dnt.shims.js +61 -0
- package/esm/helpers/createFolderStructure.d.ts +2 -0
- package/esm/helpers/createFolderStructure.d.ts.map +1 -0
- package/esm/helpers/createFolderStructure.js +49 -0
- package/esm/helpers/ensureAgents.d.ts +2 -0
- package/esm/helpers/ensureAgents.d.ts.map +1 -0
- package/esm/helpers/ensureAgents.js +92 -0
- package/esm/helpers/ensureEnvFile.d.ts +2 -0
- package/esm/helpers/ensureEnvFile.d.ts.map +1 -0
- package/esm/helpers/ensureEnvFile.js +14 -0
- package/esm/helpers/ensureGitignore.d.ts +2 -0
- package/esm/helpers/ensureGitignore.d.ts.map +1 -0
- package/esm/helpers/ensureGitignore.js +29 -0
- package/esm/helpers/ensureReadme.d.ts +2 -0
- package/esm/helpers/ensureReadme.d.ts.map +1 -0
- package/esm/helpers/ensureReadme.js +37 -0
- package/esm/helpers/getInstalledPackages.d.ts +2 -0
- package/esm/helpers/getInstalledPackages.d.ts.map +1 -0
- package/esm/helpers/getInstalledPackages.js +29 -0
- package/esm/helpers/getProjectTasks.d.ts +5 -0
- package/esm/helpers/getProjectTasks.d.ts.map +1 -0
- package/esm/helpers/getProjectTasks.js +12 -0
- package/esm/helpers/getRuntime.d.ts +5 -0
- package/esm/helpers/getRuntime.d.ts.map +1 -0
- package/esm/helpers/getRuntime.js +17 -0
- package/esm/helpers/gitignoreEntries.d.ts +2 -0
- package/esm/helpers/gitignoreEntries.d.ts.map +1 -0
- package/esm/helpers/gitignoreEntries.js +9 -0
- package/esm/helpers/handleFileConflict.d.ts +5 -0
- package/esm/helpers/handleFileConflict.d.ts.map +1 -0
- package/esm/helpers/handleFileConflict.js +51 -0
- package/esm/helpers/installPackagesAndFetchDocs.d.ts +8 -0
- package/esm/helpers/installPackagesAndFetchDocs.d.ts.map +1 -0
- package/esm/helpers/installPackagesAndFetchDocs.js +61 -0
- package/esm/helpers/packageOptions.d.ts +5 -0
- package/esm/helpers/packageOptions.d.ts.map +1 -0
- package/esm/helpers/packageOptions.js +5 -0
- package/esm/helpers/packageRegistry.d.ts +7 -0
- package/esm/helpers/packageRegistry.d.ts.map +1 -0
- package/esm/helpers/packageRegistry.js +62 -0
- package/esm/helpers/updateProjectConfig.d.ts +2 -0
- package/esm/helpers/updateProjectConfig.d.ts.map +1 -0
- package/esm/helpers/updateProjectConfig.js +36 -0
- package/esm/main.d.ts +3 -0
- package/esm/main.d.ts.map +1 -0
- package/esm/main.js +93 -0
- package/esm/package.json +3 -0
- package/npm/LICENSE +21 -0
- package/npm/README.md +25 -0
- package/npm/esm/_dnt.shims.d.ts +8 -0
- package/npm/esm/_dnt.shims.d.ts.map +1 -0
- package/npm/esm/_dnt.shims.js +62 -0
- package/npm/esm/_dnt_2.shims.d.ts +6 -0
- package/npm/esm/_dnt_2.shims.d.ts.map +1 -0
- package/npm/esm/_dnt_2.shims.js +61 -0
- package/npm/esm/helpers/createFolderStructure.d.ts +2 -0
- package/npm/esm/helpers/createFolderStructure.d.ts.map +1 -0
- package/npm/esm/helpers/createFolderStructure.js +49 -0
- package/npm/esm/helpers/ensureAgents.d.ts +2 -0
- package/npm/esm/helpers/ensureAgents.d.ts.map +1 -0
- package/npm/esm/helpers/ensureAgents.js +92 -0
- package/npm/esm/helpers/ensureEnvFile.d.ts +2 -0
- package/npm/esm/helpers/ensureEnvFile.d.ts.map +1 -0
- package/npm/esm/helpers/ensureEnvFile.js +14 -0
- package/npm/esm/helpers/ensureGitignore.d.ts +2 -0
- package/npm/esm/helpers/ensureGitignore.d.ts.map +1 -0
- package/npm/esm/helpers/ensureGitignore.js +29 -0
- package/npm/esm/helpers/ensureReadme.d.ts +2 -0
- package/npm/esm/helpers/ensureReadme.d.ts.map +1 -0
- package/npm/esm/helpers/ensureReadme.js +37 -0
- package/npm/esm/helpers/getInstalledPackages.d.ts +2 -0
- package/npm/esm/helpers/getInstalledPackages.d.ts.map +1 -0
- package/npm/esm/helpers/getInstalledPackages.js +29 -0
- package/npm/esm/helpers/getProjectTasks.d.ts +5 -0
- package/npm/esm/helpers/getProjectTasks.d.ts.map +1 -0
- package/npm/esm/helpers/getProjectTasks.js +12 -0
- package/npm/esm/helpers/getRuntime.d.ts +5 -0
- package/npm/esm/helpers/getRuntime.d.ts.map +1 -0
- package/npm/esm/helpers/getRuntime.js +17 -0
- package/npm/esm/helpers/gitignoreEntries.d.ts +2 -0
- package/npm/esm/helpers/gitignoreEntries.d.ts.map +1 -0
- package/npm/esm/helpers/gitignoreEntries.js +9 -0
- package/npm/esm/helpers/handleFileConflict.d.ts +5 -0
- package/npm/esm/helpers/handleFileConflict.d.ts.map +1 -0
- package/npm/esm/helpers/handleFileConflict.js +51 -0
- package/npm/esm/helpers/installPackagesAndFetchDocs.d.ts +8 -0
- package/npm/esm/helpers/installPackagesAndFetchDocs.d.ts.map +1 -0
- package/npm/esm/helpers/installPackagesAndFetchDocs.js +61 -0
- package/npm/esm/helpers/packageOptions.d.ts +5 -0
- package/npm/esm/helpers/packageOptions.d.ts.map +1 -0
- package/npm/esm/helpers/packageOptions.js +5 -0
- package/npm/esm/helpers/packageRegistry.d.ts +7 -0
- package/npm/esm/helpers/packageRegistry.d.ts.map +1 -0
- package/npm/esm/helpers/packageRegistry.js +62 -0
- package/npm/esm/helpers/updateProjectConfig.d.ts +2 -0
- package/npm/esm/helpers/updateProjectConfig.d.ts.map +1 -0
- package/npm/esm/helpers/updateProjectConfig.js +36 -0
- package/npm/esm/main.d.ts +3 -0
- package/npm/esm/main.d.ts.map +1 -0
- package/npm/esm/main.js +93 -0
- package/npm/esm/package.json +3 -0
- package/npm/node_modules/.package-lock.json +123 -0
- package/npm/node_modules/@clack/core/CHANGELOG.md +348 -0
- package/npm/node_modules/@clack/core/LICENSE +9 -0
- package/npm/node_modules/@clack/core/README.md +22 -0
- package/npm/node_modules/@clack/core/dist/index.d.mts +363 -0
- package/npm/node_modules/@clack/core/dist/index.mjs +17 -0
- package/npm/node_modules/@clack/core/dist/index.mjs.map +1 -0
- package/npm/node_modules/@clack/core/package.json +63 -0
- package/npm/node_modules/@clack/prompts/CHANGELOG.md +591 -0
- package/npm/node_modules/@clack/prompts/LICENSE +9 -0
- package/npm/node_modules/@clack/prompts/README.md +375 -0
- package/npm/node_modules/@clack/prompts/dist/index.d.mts +396 -0
- package/npm/node_modules/@clack/prompts/dist/index.mjs +144 -0
- package/npm/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
- package/npm/node_modules/@clack/prompts/package.json +68 -0
- package/npm/node_modules/@deno/shim-deno/LICENSE +20 -0
- package/npm/node_modules/@deno/shim-deno/README.md +30 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/Conn.js +56 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/Listener.js +92 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/consts.js +4 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/errorMap.js +44 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/fs_flags.js +91 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/iterutil.js +37 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/random_id.js +8 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/streams.js +122 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/test.d.ts +1 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/test.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/internal/version.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/FsFile.js +143 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/PermissionStatus.js +19 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes/Permissions.js +26 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/classes.js +10 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/enums/SeekMode.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/enums.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/addSignalListener.js +18 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chdir.js +22 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmod.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chmodSync.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chown.js +30 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/chownSync.js +30 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/close.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/connect.js +37 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/connectTls.js +31 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/consoleSize.js +17 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copy.js +27 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFile.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/copyFileSync.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/create.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/createSync.js +14 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/cwd.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/execPath.js +10 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/exit.js +8 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fdatasync.js +8 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fdatasyncSync.js +6 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fstat.js +44 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fstatSync.js +19 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fsync.js +10 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/fsyncSync.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/ftruncate.js +8 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/ftruncateSync.js +6 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/gid.js +10 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/hostname.js +32 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/inspect.js +30 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/kill.js +16 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/link.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/linkSync.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/listen.js +51 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/listenTls.js +49 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/loadavg.js +32 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstat.js +42 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/lstatSync.js +42 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDir.js +11 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempDirSync.js +11 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempFile.js +14 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/makeTempFileSync.js +14 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/memoryUsage.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdir.js +22 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/mkdirSync.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/open.js +33 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/openSync.js +31 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/osRelease.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/osUptime.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/read.js +19 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readDir.js +26 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readDirSync.js +26 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readFile.js +19 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readFileSync.js +19 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readLink.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readLinkSync.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readSync.js +34 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFile.js +18 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/readTextFileSync.js +41 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/realPath.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/realPathSync.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/remove.js +22 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/removeSignalListener.js +12 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/removeSync.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/rename.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/renameSync.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/resolveDns.js +41 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/run.js +276 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/shutdown.js +9 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/stat.js +68 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/statSync.js +42 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/symlink.js +30 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/symlinkSync.js +30 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/test.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/truncate.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/truncateSync.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/uid.js +10 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/watchFs.js +27 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/write.js +35 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFile.js +46 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeFileSync.js +45 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeSync.js +29 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFile.js +52 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions/writeTextFileSync.js +44 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/functions.js +234 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/main.js +21 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/types.js +3 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/args.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/build.js +38 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/customInspect.js +4 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/env.js +47 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/errors.js +63 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/mainModule.js +8 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/metrics.js +21 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/noColor.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/permissions.js +6 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/pid.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/ppid.js +5 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/resources.js +12 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/std.js +132 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables/version.js +10 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/stable/variables.js +53 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno/unstable/main.js +62 -0
- package/npm/node_modules/@deno/shim-deno/dist/deno.js +17 -0
- package/npm/node_modules/@deno/shim-deno/dist/index.d.ts +4762 -0
- package/npm/node_modules/@deno/shim-deno/dist/index.js +27 -0
- package/npm/node_modules/@deno/shim-deno/package.json +50 -0
- package/npm/node_modules/@deno/shim-deno-test/LICENSE +20 -0
- package/npm/node_modules/@deno/shim-deno-test/README.md +28 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/definitions.d.ts +3 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/definitions.js +5 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/deno.types.gen.d.ts +626 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/deno.types.gen.js +2 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/index.d.ts +3 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/index.js +21 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/test.d.ts +3 -0
- package/npm/node_modules/@deno/shim-deno-test/dist/test.js +87 -0
- package/npm/node_modules/@deno/shim-deno-test/package.json +34 -0
- package/npm/node_modules/@types/node/LICENSE +21 -0
- package/npm/node_modules/@types/node/README.md +15 -0
- package/npm/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/npm/node_modules/@types/node/assert.d.ts +1062 -0
- package/npm/node_modules/@types/node/async_hooks.d.ts +605 -0
- package/npm/node_modules/@types/node/buffer.buffer.d.ts +471 -0
- package/npm/node_modules/@types/node/buffer.d.ts +1936 -0
- package/npm/node_modules/@types/node/child_process.d.ts +1475 -0
- package/npm/node_modules/@types/node/cluster.d.ts +577 -0
- package/npm/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
- package/npm/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/npm/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/npm/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/npm/node_modules/@types/node/console.d.ts +452 -0
- package/npm/node_modules/@types/node/constants.d.ts +21 -0
- package/npm/node_modules/@types/node/crypto.d.ts +4590 -0
- package/npm/node_modules/@types/node/dgram.d.ts +597 -0
- package/npm/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/npm/node_modules/@types/node/dns/promises.d.ts +479 -0
- package/npm/node_modules/@types/node/dns.d.ts +871 -0
- package/npm/node_modules/@types/node/domain.d.ts +170 -0
- package/npm/node_modules/@types/node/events.d.ts +977 -0
- package/npm/node_modules/@types/node/fs/promises.d.ts +1270 -0
- package/npm/node_modules/@types/node/fs.d.ts +4375 -0
- package/npm/node_modules/@types/node/globals.d.ts +172 -0
- package/npm/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/npm/node_modules/@types/node/http.d.ts +2049 -0
- package/npm/node_modules/@types/node/http2.d.ts +2631 -0
- package/npm/node_modules/@types/node/https.d.ts +578 -0
- package/npm/node_modules/@types/node/index.d.ts +93 -0
- package/npm/node_modules/@types/node/inspector.generated.d.ts +3966 -0
- package/npm/node_modules/@types/node/module.d.ts +539 -0
- package/npm/node_modules/@types/node/net.d.ts +1031 -0
- package/npm/node_modules/@types/node/os.d.ts +506 -0
- package/npm/node_modules/@types/node/package.json +140 -0
- package/npm/node_modules/@types/node/path.d.ts +200 -0
- package/npm/node_modules/@types/node/perf_hooks.d.ts +961 -0
- package/npm/node_modules/@types/node/process.d.ts +1961 -0
- package/npm/node_modules/@types/node/punycode.d.ts +117 -0
- package/npm/node_modules/@types/node/querystring.d.ts +152 -0
- package/npm/node_modules/@types/node/readline/promises.d.ts +162 -0
- package/npm/node_modules/@types/node/readline.d.ts +589 -0
- package/npm/node_modules/@types/node/repl.d.ts +430 -0
- package/npm/node_modules/@types/node/sea.d.ts +153 -0
- package/npm/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/npm/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/npm/node_modules/@types/node/stream/web.d.ts +533 -0
- package/npm/node_modules/@types/node/stream.d.ts +1698 -0
- package/npm/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/npm/node_modules/@types/node/test.d.ts +1787 -0
- package/npm/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/npm/node_modules/@types/node/timers.d.ts +286 -0
- package/npm/node_modules/@types/node/tls.d.ts +1259 -0
- package/npm/node_modules/@types/node/trace_events.d.ts +197 -0
- package/npm/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/npm/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/npm/node_modules/@types/node/ts5.6/index.d.ts +93 -0
- package/npm/node_modules/@types/node/tty.d.ts +208 -0
- package/npm/node_modules/@types/node/url.d.ts +964 -0
- package/npm/node_modules/@types/node/util.d.ts +2331 -0
- package/npm/node_modules/@types/node/v8.d.ts +809 -0
- package/npm/node_modules/@types/node/vm.d.ts +1001 -0
- package/npm/node_modules/@types/node/wasi.d.ts +181 -0
- package/npm/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/npm/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/npm/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/npm/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/npm/node_modules/@types/node/worker_threads.d.ts +715 -0
- package/npm/node_modules/@types/node/zlib.d.ts +598 -0
- package/npm/node_modules/fast-string-truncated-width/dist/index.d.ts +4 -0
- package/npm/node_modules/fast-string-truncated-width/dist/index.js +111 -0
- package/npm/node_modules/fast-string-truncated-width/dist/types.d.ts +19 -0
- package/npm/node_modules/fast-string-truncated-width/dist/types.js +2 -0
- package/npm/node_modules/fast-string-truncated-width/dist/utils.d.ts +4 -0
- package/npm/node_modules/fast-string-truncated-width/dist/utils.js +20 -0
- package/npm/node_modules/fast-string-truncated-width/license +21 -0
- package/npm/node_modules/fast-string-truncated-width/package.json +35 -0
- package/npm/node_modules/fast-string-truncated-width/readme.md +59 -0
- package/npm/node_modules/fast-string-width/dist/index.d.ts +4 -0
- package/npm/node_modules/fast-string-width/dist/index.js +14 -0
- package/npm/node_modules/fast-string-width/license +21 -0
- package/npm/node_modules/fast-string-width/package.json +34 -0
- package/npm/node_modules/fast-string-width/readme.md +42 -0
- package/npm/node_modules/fast-wrap-ansi/LICENSE +23 -0
- package/npm/node_modules/fast-wrap-ansi/README.md +26 -0
- package/npm/node_modules/fast-wrap-ansi/lib/main.d.ts +6 -0
- package/npm/node_modules/fast-wrap-ansi/lib/main.js +219 -0
- package/npm/node_modules/fast-wrap-ansi/lib/main.js.map +1 -0
- package/npm/node_modules/fast-wrap-ansi/package.json +51 -0
- package/npm/node_modules/isexe/LICENSE.md +55 -0
- package/npm/node_modules/isexe/README.md +80 -0
- package/npm/node_modules/isexe/dist/commonjs/index.d.ts +14 -0
- package/npm/node_modules/isexe/dist/commonjs/index.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/index.js +56 -0
- package/npm/node_modules/isexe/dist/commonjs/index.js.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/index.min.js +2 -0
- package/npm/node_modules/isexe/dist/commonjs/index.min.js.map +7 -0
- package/npm/node_modules/isexe/dist/commonjs/options.d.ts +32 -0
- package/npm/node_modules/isexe/dist/commonjs/options.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/options.js +3 -0
- package/npm/node_modules/isexe/dist/commonjs/options.js.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/package.json +3 -0
- package/npm/node_modules/isexe/dist/commonjs/posix.d.ts +18 -0
- package/npm/node_modules/isexe/dist/commonjs/posix.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/posix.js +67 -0
- package/npm/node_modules/isexe/dist/commonjs/posix.js.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/win32.d.ts +18 -0
- package/npm/node_modules/isexe/dist/commonjs/win32.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/commonjs/win32.js +63 -0
- package/npm/node_modules/isexe/dist/commonjs/win32.js.map +1 -0
- package/npm/node_modules/isexe/dist/esm/index.d.ts +14 -0
- package/npm/node_modules/isexe/dist/esm/index.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/esm/index.js +16 -0
- package/npm/node_modules/isexe/dist/esm/index.js.map +1 -0
- package/npm/node_modules/isexe/dist/esm/index.min.js +2 -0
- package/npm/node_modules/isexe/dist/esm/index.min.js.map +7 -0
- package/npm/node_modules/isexe/dist/esm/options.d.ts +32 -0
- package/npm/node_modules/isexe/dist/esm/options.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/esm/options.js +2 -0
- package/npm/node_modules/isexe/dist/esm/options.js.map +1 -0
- package/npm/node_modules/isexe/dist/esm/package.json +3 -0
- package/npm/node_modules/isexe/dist/esm/posix.d.ts +18 -0
- package/npm/node_modules/isexe/dist/esm/posix.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/esm/posix.js +62 -0
- package/npm/node_modules/isexe/dist/esm/posix.js.map +1 -0
- package/npm/node_modules/isexe/dist/esm/win32.d.ts +18 -0
- package/npm/node_modules/isexe/dist/esm/win32.d.ts.map +1 -0
- package/npm/node_modules/isexe/dist/esm/win32.js +58 -0
- package/npm/node_modules/isexe/dist/esm/win32.js.map +1 -0
- package/npm/node_modules/isexe/package.json +78 -0
- package/npm/node_modules/sisteransi/license +21 -0
- package/npm/node_modules/sisteransi/package.json +34 -0
- package/npm/node_modules/sisteransi/readme.md +113 -0
- package/npm/node_modules/sisteransi/src/index.js +58 -0
- package/npm/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
- package/npm/node_modules/undici-types/LICENSE +21 -0
- package/npm/node_modules/undici-types/README.md +6 -0
- package/npm/node_modules/undici-types/agent.d.ts +31 -0
- package/npm/node_modules/undici-types/api.d.ts +43 -0
- package/npm/node_modules/undici-types/balanced-pool.d.ts +29 -0
- package/npm/node_modules/undici-types/cache.d.ts +36 -0
- package/npm/node_modules/undici-types/client.d.ts +108 -0
- package/npm/node_modules/undici-types/connector.d.ts +34 -0
- package/npm/node_modules/undici-types/content-type.d.ts +21 -0
- package/npm/node_modules/undici-types/cookies.d.ts +28 -0
- package/npm/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
- package/npm/node_modules/undici-types/dispatcher.d.ts +256 -0
- package/npm/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
- package/npm/node_modules/undici-types/errors.d.ts +149 -0
- package/npm/node_modules/undici-types/eventsource.d.ts +61 -0
- package/npm/node_modules/undici-types/fetch.d.ts +209 -0
- package/npm/node_modules/undici-types/file.d.ts +39 -0
- package/npm/node_modules/undici-types/filereader.d.ts +54 -0
- package/npm/node_modules/undici-types/formdata.d.ts +108 -0
- package/npm/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/npm/node_modules/undici-types/global-origin.d.ts +7 -0
- package/npm/node_modules/undici-types/handlers.d.ts +15 -0
- package/npm/node_modules/undici-types/header.d.ts +4 -0
- package/npm/node_modules/undici-types/index.d.ts +71 -0
- package/npm/node_modules/undici-types/interceptors.d.ts +17 -0
- package/npm/node_modules/undici-types/mock-agent.d.ts +50 -0
- package/npm/node_modules/undici-types/mock-client.d.ts +25 -0
- package/npm/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/npm/node_modules/undici-types/mock-interceptor.d.ts +93 -0
- package/npm/node_modules/undici-types/mock-pool.d.ts +25 -0
- package/npm/node_modules/undici-types/package.json +55 -0
- package/npm/node_modules/undici-types/patch.d.ts +33 -0
- package/npm/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/npm/node_modules/undici-types/pool.d.ts +39 -0
- package/npm/node_modules/undici-types/proxy-agent.d.ts +28 -0
- package/npm/node_modules/undici-types/readable.d.ts +65 -0
- package/npm/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/npm/node_modules/undici-types/retry-handler.d.ts +116 -0
- package/npm/node_modules/undici-types/util.d.ts +18 -0
- package/npm/node_modules/undici-types/webidl.d.ts +228 -0
- package/npm/node_modules/undici-types/websocket.d.ts +150 -0
- package/npm/node_modules/which/LICENSE +15 -0
- package/npm/node_modules/which/README.md +51 -0
- package/npm/node_modules/which/bin/which.js +52 -0
- package/npm/node_modules/which/lib/index.js +111 -0
- package/npm/node_modules/which/package.json +57 -0
- package/npm/package-lock.json +135 -0
- package/npm/package.json +30 -0
- package/npm/script/_dnt.shims.d.ts +8 -0
- package/npm/script/_dnt.shims.d.ts.map +1 -0
- package/npm/script/_dnt.shims.js +99 -0
- package/npm/script/_dnt_2.shims.d.ts +6 -0
- package/npm/script/_dnt_2.shims.d.ts.map +1 -0
- package/npm/script/_dnt_2.shims.js +65 -0
- package/npm/script/helpers/createFolderStructure.d.ts +2 -0
- package/npm/script/helpers/createFolderStructure.d.ts.map +1 -0
- package/npm/script/helpers/createFolderStructure.js +52 -0
- package/npm/script/helpers/ensureAgents.d.ts +2 -0
- package/npm/script/helpers/ensureAgents.d.ts.map +1 -0
- package/npm/script/helpers/ensureAgents.js +95 -0
- package/npm/script/helpers/ensureEnvFile.d.ts +2 -0
- package/npm/script/helpers/ensureEnvFile.d.ts.map +1 -0
- package/npm/script/helpers/ensureEnvFile.js +17 -0
- package/npm/script/helpers/ensureGitignore.d.ts +2 -0
- package/npm/script/helpers/ensureGitignore.d.ts.map +1 -0
- package/npm/script/helpers/ensureGitignore.js +32 -0
- package/npm/script/helpers/ensureReadme.d.ts +2 -0
- package/npm/script/helpers/ensureReadme.d.ts.map +1 -0
- package/npm/script/helpers/ensureReadme.js +40 -0
- package/npm/script/helpers/getInstalledPackages.d.ts +2 -0
- package/npm/script/helpers/getInstalledPackages.d.ts.map +1 -0
- package/npm/script/helpers/getInstalledPackages.js +32 -0
- package/npm/script/helpers/getProjectTasks.d.ts +5 -0
- package/npm/script/helpers/getProjectTasks.d.ts.map +1 -0
- package/npm/script/helpers/getProjectTasks.js +15 -0
- package/npm/script/helpers/getRuntime.d.ts +5 -0
- package/npm/script/helpers/getRuntime.d.ts.map +1 -0
- package/npm/script/helpers/getRuntime.js +57 -0
- package/npm/script/helpers/gitignoreEntries.d.ts +2 -0
- package/npm/script/helpers/gitignoreEntries.d.ts.map +1 -0
- package/npm/script/helpers/gitignoreEntries.js +12 -0
- package/npm/script/helpers/handleFileConflict.d.ts +5 -0
- package/npm/script/helpers/handleFileConflict.d.ts.map +1 -0
- package/npm/script/helpers/handleFileConflict.js +91 -0
- package/npm/script/helpers/installPackagesAndFetchDocs.d.ts +8 -0
- package/npm/script/helpers/installPackagesAndFetchDocs.d.ts.map +1 -0
- package/npm/script/helpers/installPackagesAndFetchDocs.js +98 -0
- package/npm/script/helpers/packageOptions.d.ts +5 -0
- package/npm/script/helpers/packageOptions.d.ts.map +1 -0
- package/npm/script/helpers/packageOptions.js +8 -0
- package/npm/script/helpers/packageRegistry.d.ts +7 -0
- package/npm/script/helpers/packageRegistry.d.ts.map +1 -0
- package/npm/script/helpers/packageRegistry.js +65 -0
- package/npm/script/helpers/updateProjectConfig.d.ts +2 -0
- package/npm/script/helpers/updateProjectConfig.d.ts.map +1 -0
- package/npm/script/helpers/updateProjectConfig.js +39 -0
- package/npm/script/main.d.ts +3 -0
- package/npm/script/main.d.ts.map +1 -0
- package/npm/script/main.js +98 -0
- package/npm/script/package.json +3 -0
- package/package.json +27 -0
- package/script/_dnt.shims.d.ts +6 -0
- package/script/_dnt.shims.d.ts.map +1 -0
- package/script/_dnt.shims.js +65 -0
- package/script/helpers/createFolderStructure.d.ts +2 -0
- package/script/helpers/createFolderStructure.d.ts.map +1 -0
- package/script/helpers/createFolderStructure.js +52 -0
- package/script/helpers/ensureAgents.d.ts +2 -0
- package/script/helpers/ensureAgents.d.ts.map +1 -0
- package/script/helpers/ensureAgents.js +95 -0
- package/script/helpers/ensureEnvFile.d.ts +2 -0
- package/script/helpers/ensureEnvFile.d.ts.map +1 -0
- package/script/helpers/ensureEnvFile.js +17 -0
- package/script/helpers/ensureGitignore.d.ts +2 -0
- package/script/helpers/ensureGitignore.d.ts.map +1 -0
- package/script/helpers/ensureGitignore.js +32 -0
- package/script/helpers/ensureReadme.d.ts +2 -0
- package/script/helpers/ensureReadme.d.ts.map +1 -0
- package/script/helpers/ensureReadme.js +40 -0
- package/script/helpers/getInstalledPackages.d.ts +2 -0
- package/script/helpers/getInstalledPackages.d.ts.map +1 -0
- package/script/helpers/getInstalledPackages.js +32 -0
- package/script/helpers/getProjectTasks.d.ts +5 -0
- package/script/helpers/getProjectTasks.d.ts.map +1 -0
- package/script/helpers/getProjectTasks.js +15 -0
- package/script/helpers/getRuntime.d.ts +5 -0
- package/script/helpers/getRuntime.d.ts.map +1 -0
- package/script/helpers/getRuntime.js +57 -0
- package/script/helpers/gitignoreEntries.d.ts +2 -0
- package/script/helpers/gitignoreEntries.d.ts.map +1 -0
- package/script/helpers/gitignoreEntries.js +12 -0
- package/script/helpers/handleFileConflict.d.ts +5 -0
- package/script/helpers/handleFileConflict.d.ts.map +1 -0
- package/script/helpers/handleFileConflict.js +91 -0
- package/script/helpers/installPackagesAndFetchDocs.d.ts +8 -0
- package/script/helpers/installPackagesAndFetchDocs.d.ts.map +1 -0
- package/script/helpers/installPackagesAndFetchDocs.js +98 -0
- package/script/helpers/packageOptions.d.ts +5 -0
- package/script/helpers/packageOptions.d.ts.map +1 -0
- package/script/helpers/packageOptions.js +8 -0
- package/script/helpers/packageRegistry.d.ts +7 -0
- package/script/helpers/packageRegistry.d.ts.map +1 -0
- package/script/helpers/packageRegistry.js +65 -0
- package/script/helpers/updateProjectConfig.d.ts +2 -0
- package/script/helpers/updateProjectConfig.d.ts.map +1 -0
- package/script/helpers/updateProjectConfig.js +39 -0
- package/script/main.d.ts +3 -0
- package/script/main.d.ts.map +1 -0
- package/script/main.js +98 -0
- package/script/package.json +3 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This is the Posix implementation of isexe, which uses the file
|
|
4
|
+
* mode and uid/gid values.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.sync = exports.isexe = void 0;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const promises_1 = require("node:fs/promises");
|
|
12
|
+
/**
|
|
13
|
+
* Determine whether a path is executable according to the mode and
|
|
14
|
+
* current (or specified) user and group IDs.
|
|
15
|
+
*/
|
|
16
|
+
const isexe = async (path, options = {}) => {
|
|
17
|
+
const { ignoreErrors = false } = options;
|
|
18
|
+
try {
|
|
19
|
+
return checkStat(await (0, promises_1.stat)(path), options);
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
const er = e;
|
|
23
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
24
|
+
return false;
|
|
25
|
+
throw er;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
exports.isexe = isexe;
|
|
29
|
+
/**
|
|
30
|
+
* Synchronously determine whether a path is executable according to
|
|
31
|
+
* the mode and current (or specified) user and group IDs.
|
|
32
|
+
*/
|
|
33
|
+
const sync = (path, options = {}) => {
|
|
34
|
+
const { ignoreErrors = false } = options;
|
|
35
|
+
try {
|
|
36
|
+
return checkStat((0, node_fs_1.statSync)(path), options);
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
const er = e;
|
|
40
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
41
|
+
return false;
|
|
42
|
+
throw er;
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.sync = sync;
|
|
46
|
+
const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
|
|
47
|
+
const checkMode = (stat, options) => {
|
|
48
|
+
const myUid = options.uid ?? process.getuid?.();
|
|
49
|
+
const myGroups = options.groups ?? process.getgroups?.() ?? [];
|
|
50
|
+
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
|
|
51
|
+
if (myUid === undefined || myGid === undefined) {
|
|
52
|
+
throw new Error('cannot get uid or gid');
|
|
53
|
+
}
|
|
54
|
+
const groups = new Set([myGid, ...myGroups]);
|
|
55
|
+
const mod = stat.mode;
|
|
56
|
+
const uid = stat.uid;
|
|
57
|
+
const gid = stat.gid;
|
|
58
|
+
const u = parseInt('100', 8);
|
|
59
|
+
const g = parseInt('010', 8);
|
|
60
|
+
const o = parseInt('001', 8);
|
|
61
|
+
const ug = u | g;
|
|
62
|
+
return !!(mod & o ||
|
|
63
|
+
(mod & g && groups.has(gid)) ||
|
|
64
|
+
(mod & u && uid === myUid) ||
|
|
65
|
+
(mod & ug && myUid === 0));
|
|
66
|
+
};
|
|
67
|
+
//# sourceMappingURL=posix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posix.js","sourceRoot":"","sources":["../../src/posix.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,qCAAyC;AACzC,+CAAuC;AAGvC;;;GAGG;AACI,MAAM,KAAK,GAAG,KAAK,EACxB,IAAY,EACZ,UAAwB,EAAE,EACR,EAAE;IACpB,MAAM,EAAE,YAAY,GAAG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AAM,KAAK,GAAG,OAAO,CAAC,GAAG,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC9D,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/C,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAA;IAC1C,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA;IAE5C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAA;IACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;IACpB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;IAEpB,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC5B,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC5B,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC5B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IAEhB,OAAO,CAAC,CAAC,CACP,GAAG,GAAG,CAAC;QACP,CAAC,GAAG,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,KAAK,KAAK,CAAC;QAC1B,CAAC,GAAG,GAAG,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAC1B,CAAA;AACH,CAAC,CAAA","sourcesContent":["/**\n * This is the Posix implementation of isexe, which uses the file\n * mode and uid/gid values.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\n\n/**\n * Determine whether a path is executable according to the mode and\n * current (or specified) user and group IDs.\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable according to\n * the mode and current (or specified) user and group IDs.\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkStat = (stat: Stats, options: IsexeOptions) =>\n stat.isFile() && checkMode(stat, options)\n\nconst checkMode = (stat: Stats, options: IsexeOptions) => {\n const myUid = options.uid ?? process.getuid?.()\n const myGroups = options.groups ?? process.getgroups?.() ?? []\n const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]\n if (myUid === undefined || myGid === undefined) {\n throw new Error('cannot get uid or gid')\n }\n\n const groups = new Set([myGid, ...myGroups])\n\n const mod = stat.mode\n const uid = stat.uid\n const gid = stat.gid\n\n const u = parseInt('100', 8)\n const g = parseInt('010', 8)\n const o = parseInt('001', 8)\n const ug = u | g\n\n return !!(\n mod & o ||\n (mod & g && groups.has(gid)) ||\n (mod & u && uid === myUid) ||\n (mod & ug && myUid === 0)\n )\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the Windows implementation of isexe, which uses the file
|
|
3
|
+
* extension and PATHEXT setting.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { IsexeOptions } from './options.js';
|
|
8
|
+
/**
|
|
9
|
+
* Determine whether a path is executable based on the file extension
|
|
10
|
+
* and PATHEXT environment variable (or specified pathExt option)
|
|
11
|
+
*/
|
|
12
|
+
export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronously determine whether a path is executable based on the file
|
|
15
|
+
* extension and PATHEXT environment variable (or specified pathExt option)
|
|
16
|
+
*/
|
|
17
|
+
export declare const sync: (path: string, options?: IsexeOptions) => boolean;
|
|
18
|
+
//# sourceMappingURL=win32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"win32.d.ts","sourceRoot":"","sources":["../../src/win32.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C;;;GAGG;AACH,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,UAAS,YAAiB,KACzB,OAAO,CAAC,OAAO,CASjB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,MAAM,EACZ,UAAS,YAAiB,KACzB,OASF,CAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This is the Windows implementation of isexe, which uses the file
|
|
4
|
+
* extension and PATHEXT setting.
|
|
5
|
+
*
|
|
6
|
+
* @module
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.sync = exports.isexe = void 0;
|
|
10
|
+
const node_fs_1 = require("node:fs");
|
|
11
|
+
const promises_1 = require("node:fs/promises");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
|
+
/**
|
|
14
|
+
* Determine whether a path is executable based on the file extension
|
|
15
|
+
* and PATHEXT environment variable (or specified pathExt option)
|
|
16
|
+
*/
|
|
17
|
+
const isexe = async (path, options = {}) => {
|
|
18
|
+
const { ignoreErrors = false } = options;
|
|
19
|
+
try {
|
|
20
|
+
return checkStat(await (0, promises_1.stat)(path), path, options);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
const er = e;
|
|
24
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
25
|
+
return false;
|
|
26
|
+
throw er;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
exports.isexe = isexe;
|
|
30
|
+
/**
|
|
31
|
+
* Synchronously determine whether a path is executable based on the file
|
|
32
|
+
* extension and PATHEXT environment variable (or specified pathExt option)
|
|
33
|
+
*/
|
|
34
|
+
const sync = (path, options = {}) => {
|
|
35
|
+
const { ignoreErrors = false } = options;
|
|
36
|
+
try {
|
|
37
|
+
return checkStat((0, node_fs_1.statSync)(path), path, options);
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
const er = e;
|
|
41
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
42
|
+
return false;
|
|
43
|
+
throw er;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
exports.sync = sync;
|
|
47
|
+
const checkPathExt = (path, options) => {
|
|
48
|
+
const { pathExt = process.env.PATHEXT || '' } = options;
|
|
49
|
+
const peSplit = pathExt.split(node_path_1.delimiter);
|
|
50
|
+
if (peSplit.indexOf('') !== -1) {
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
for (const pes of peSplit) {
|
|
54
|
+
const p = pes.toLowerCase();
|
|
55
|
+
const ext = path.substring(path.length - p.length).toLowerCase();
|
|
56
|
+
if (p && ext === p) {
|
|
57
|
+
return true;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return false;
|
|
61
|
+
};
|
|
62
|
+
const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);
|
|
63
|
+
//# sourceMappingURL=win32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"win32.js","sourceRoot":"","sources":["../../src/win32.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,qCAAyC;AACzC,+CAAuC;AAEvC,yCAAqC;AAErC;;;GAGG;AACI,MAAM,KAAK,GAAG,KAAK,EACxB,IAAY,EACZ,UAAwB,EAAE,EACR,EAAE;IACpB,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,OAAO,C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M,CAAC,GAAG,GAAG,CAAC,WAAW,EAAE,CAAA;QAC3B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,CAAA;QAEhE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,EAAE,CAAC;YACnB,OAAO,IAAI,CAAA;QACb,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC,CAAA;AAED,MAAM,SAAS,GAAG,CAAC,IAAW,EAAE,IAAY,EAAE,OAAqB,EAAE,EAAE,CACrE,IAAI,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA","sourcesContent":["/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\nimport { delimiter } from 'node:path'\n\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkPathExt = (path: string, options: IsexeOptions) => {\n const { pathExt = process.env.PATHEXT || '' } = options\n const peSplit = pathExt.split(delimiter)\n if (peSplit.indexOf('') !== -1) {\n return true\n }\n\n for (const pes of peSplit) {\n const p = pes.toLowerCase()\n const ext = path.substring(path.length - p.length).toLowerCase()\n\n if (p && ext === p) {\n return true\n }\n }\n return false\n}\n\nconst checkStat = (stat: Stats, path: string, options: IsexeOptions) =>\n stat.isFile() && checkPathExt(path, options)\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as posix from './posix.js';
|
|
2
|
+
import * as win32 from './win32.js';
|
|
3
|
+
export * from './options.js';
|
|
4
|
+
export { win32, posix };
|
|
5
|
+
/**
|
|
6
|
+
* Determine whether a path is executable on the current platform.
|
|
7
|
+
*/
|
|
8
|
+
export declare const isexe: (path: string, options?: import("./options.js").IsexeOptions) => Promise<boolean>;
|
|
9
|
+
/**
|
|
10
|
+
* Synchronously determine whether a path is executable on the
|
|
11
|
+
* current platform.
|
|
12
|
+
*/
|
|
13
|
+
export declare const sync: (path: string, options?: import("./options.js").IsexeOptions) => boolean;
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAKvB;;GAEG;AACH,eAAO,MAAM,KAAK,mFAAa,CAAA;AAC/B;;;GAGG;AACH,eAAO,MAAM,IAAI,0EAAY,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as posix from './posix.js';
|
|
2
|
+
import * as win32 from './win32.js';
|
|
3
|
+
export * from './options.js';
|
|
4
|
+
export { win32, posix };
|
|
5
|
+
const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
|
|
6
|
+
const impl = platform === 'win32' ? win32 : posix;
|
|
7
|
+
/**
|
|
8
|
+
* Determine whether a path is executable on the current platform.
|
|
9
|
+
*/
|
|
10
|
+
export const isexe = impl.isexe;
|
|
11
|
+
/**
|
|
12
|
+
* Synchronously determine whether a path is executable on the
|
|
13
|
+
* current platform.
|
|
14
|
+
*/
|
|
15
|
+
export const sync = impl.sync;
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA;AACnC,cAAc,cAAc,CAAA;AAC5B,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;AAEvB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,OAAO,CAAC,QAAQ,CAAA;AACtE,MAAM,IAAI,GAAG,QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAA;AAEjD;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;AAC/B;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAA","sourcesContent":["import * as posix from './posix.js'\nimport * as win32 from './win32.js'\nexport * from './options.js'\nexport { win32, posix }\n\nconst platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform\nconst impl = platform === 'win32' ? win32 : posix\n\n/**\n * Determine whether a path is executable on the current platform.\n */\nexport const isexe = impl.isexe\n/**\n * Synchronously determine whether a path is executable on the\n * current platform.\n */\nexport const sync = impl.sync\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var y=Object.defineProperty;var u=(t,r)=>{for(var e in r)y(t,e,{get:r[e],enumerable:!0})};var i={};u(i,{isexe:()=>C,sync:()=>A});import{statSync as w}from"node:fs";import{stat as S}from"node:fs/promises";var C=async(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return d(await S(t),r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},A=(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return d(w(t),r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},d=(t,r)=>t.isFile()&&T(t,r),T=(t,r)=>{let e=r.uid??process.getuid?.(),s=r.groups??process.getgroups?.()??[],o=r.gid??process.getgid?.()??s[0];if(e===void 0||o===void 0)throw new Error("cannot get uid or gid");let c=new Set([o,...s]),n=t.mode,l=t.uid,E=t.gid,f=parseInt("100",8),p=parseInt("010",8),x=parseInt("001",8),h=f|p;return!!(n&x||n&p&&c.has(E)||n&f&&l===e||n&h&&e===0)};var a={};u(a,{isexe:()=>F,sync:()=>L});import{statSync as k}from"node:fs";import{stat as I}from"node:fs/promises";import{delimiter as _}from"node:path";var F=async(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return m(await I(t),t,r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},L=(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return m(k(t),t,r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},P=(t,r)=>{let{pathExt:e=process.env.PATHEXT||""}=r,s=e.split(_);if(s.indexOf("")!==-1)return!0;for(let o of s){let c=o.toLowerCase(),n=t.substring(t.length-c.length).toLowerCase();if(c&&n===c)return!0}return!1},m=(t,r,e)=>t.isFile()&&P(r,e);var v=process.env._ISEXE_TEST_PLATFORM_||process.platform,g=v==="win32"?a:i,R=g.isexe,U=g.sync;export{R as isexe,i as posix,U as sync,a as win32};
|
|
2
|
+
//# sourceMappingURL=index.min.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/posix.ts", "../../src/win32.ts", "../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * This is the Posix implementation of isexe, which uses the file\n * mode and uid/gid values.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\n\n/**\n * Determine whether a path is executable according to the mode and\n * current (or specified) user and group IDs.\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable according to\n * the mode and current (or specified) user and group IDs.\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkStat = (stat: Stats, options: IsexeOptions) =>\n stat.isFile() && checkMode(stat, options)\n\nconst checkMode = (stat: Stats, options: IsexeOptions) => {\n const myUid = options.uid ?? process.getuid?.()\n const myGroups = options.groups ?? process.getgroups?.() ?? []\n const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]\n if (myUid === undefined || myGid === undefined) {\n throw new Error('cannot get uid or gid')\n }\n\n const groups = new Set([myGid, ...myGroups])\n\n const mod = stat.mode\n const uid = stat.uid\n const gid = stat.gid\n\n const u = parseInt('100', 8)\n const g = parseInt('010', 8)\n const o = parseInt('001', 8)\n const ug = u | g\n\n return !!(\n mod & o ||\n (mod & g && groups.has(gid)) ||\n (mod & u && uid === myUid) ||\n (mod & ug && myUid === 0)\n )\n}\n", "/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\nimport { delimiter } from 'node:path'\n\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkPathExt = (path: string, options: IsexeOptions) => {\n const { pathExt = process.env.PATHEXT || '' } = options\n const peSplit = pathExt.split(delimiter)\n if (peSplit.indexOf('') !== -1) {\n return true\n }\n\n for (const pes of peSplit) {\n const p = pes.toLowerCase()\n const ext = path.substring(path.length - p.length).toLowerCase()\n\n if (p && ext === p) {\n return true\n }\n }\n return false\n}\n\nconst checkStat = (stat: Stats, path: string, options: IsexeOptions) =>\n stat.isFile() && checkPathExt(path, options)\n", "import * as posix from './posix.js'\nimport * as win32 from './win32.js'\nexport * from './options.js'\nexport { win32, posix }\n\nconst platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform\nconst impl = platform === 'win32' ? win32 : posix\n\n/**\n * Determine whether a path is executable on the current platform.\n */\nexport const isexe = impl.isexe\n/**\n * Synchronously determine whether a path is executable on the\n * current platform.\n */\nexport const sync = impl.sync\n"],
|
|
5
|
+
"mappings": "0FAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,EAAA,SAAAC,IAOA,OAAgB,YAAAC,MAAgB,UAChC,OAAS,QAAAC,MAAY,mBAOd,IAAMH,EAAQ,MACnBI,EACAC,EAAwB,CAAA,IACJ,CACpB,GAAM,CAAE,aAAAC,EAAe,EAAK,EAAKD,EACjC,GAAI,CACF,OAAOE,EAAU,MAAMJ,EAAKC,CAAI,EAAGC,CAAO,CAC5C,OAASG,EAA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EAAwB,CAAA,IACJ,CACpB,GAAM,CAAE,aAAAC,EAAe,EAAK,EAAKD,EACjC,GAAI,CACF,OAAOE,EAAU,MAAML,EAAKE,CAAI,EAAGA,EAAMC,CAAO,CAClD,OAASG,EAAG,CACV,IAAMC,EAAKD,EACX,GAAIF,GAAgBG,EAAG,OAAS,SAAU,MAAO,GACjD,MAAMA,CACR,CACF,EAMaT,EAAO,CAClBI,EACAC,EAAwB,CAAA,IACb,CACX,GAAM,CAAE,aAAAC,EAAe,EAAK,EAAKD,EACjC,GAAI,CACF,OAAOE,EAAUN,EAASG,CAAI,EAAGA,EAAMC,CAAO,CAChD,OAASG,EAAG,CACV,IAAMC,EAAKD,EACX,GAAIF,GAAgBG,EAAG,OAAS,SAAU,MAAO,GACjD,MAAMA,CACR,CACF,EAEMC,EAAe,CAACN,EAAcC,IAAyB,CAC3D,GAAM,CAAE,QAAAM,EAAU,QAAQ,IAAI,SAAW,EAAE,EAAKN,EAC1CO,EAAUD,EAAQ,MAAMR,CAAS,EACvC,GAAIS,EAAQ,QAAQ,EAAE,IAAM,GAC1B,MAAO,GAGT,QAAWC,KAAOD,EAAS,CACzB,IAAME,EAAID,EAAI,YAAW,EACnBE,EAAMX,EAAK,UAAUA,EAAK,OAASU,EAAE,MAAM,EAAE,YAAW,EAE9D,GAAIA,GAAKC,IAAQD,EACf,MAAO,EAEX,CACA,MAAO,EACT,EAEMP,EAAY,CAACL,EAAaE,EAAcC,IAC5CH,EAAK,OAAM,GAAMQ,EAAaN,EAAMC,CAAO,EC9D7C,IAAMW,EAAW,QAAQ,IAAI,uBAAyB,QAAQ,SACxDC,EAAOD,IAAa,QAAUE,EAAQC,EAK/BC,EAAQH,EAAK,MAKbI,EAAOJ,EAAK",
|
|
6
|
+
"names": ["posix_exports", "__export", "isexe", "sync", "statSync", "stat", "path", "options", "ignoreErrors", "checkStat", "e", "er", "checkMode", "myUid", "myGroups", "myGid", "groups", "mod", "uid", "gid", "u", "g", "o", "ug", "win32_exports", "__export", "isexe", "sync", "statSync", "stat", "delimiter", "path", "options", "ignoreErrors", "checkStat", "e", "er", "checkPathExt", "pathExt", "peSplit", "pes", "p", "ext", "platform", "impl", "win32_exports", "posix_exports", "isexe", "sync"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface IsexeOptions {
|
|
2
|
+
/**
|
|
3
|
+
* Ignore errors arising from attempting to get file access status
|
|
4
|
+
* Note that EACCES is always ignored, because that just means
|
|
5
|
+
* it's not executable. If this is not set, then attempting to check
|
|
6
|
+
* the executable-ness of a nonexistent file will raise ENOENT, for
|
|
7
|
+
* example.
|
|
8
|
+
*/
|
|
9
|
+
ignoreErrors?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* effective uid when checking executable mode flags on posix
|
|
12
|
+
* Defaults to process.getuid()
|
|
13
|
+
*/
|
|
14
|
+
uid?: number;
|
|
15
|
+
/**
|
|
16
|
+
* effective gid when checking executable mode flags on posix
|
|
17
|
+
* Defaults to process.getgid()
|
|
18
|
+
*/
|
|
19
|
+
gid?: number;
|
|
20
|
+
/**
|
|
21
|
+
* effective group ID list to use when checking executable mode flags
|
|
22
|
+
* on posix
|
|
23
|
+
* Defaults to process.getgroups()
|
|
24
|
+
*/
|
|
25
|
+
groups?: number[];
|
|
26
|
+
/**
|
|
27
|
+
* The ;-delimited path extension list for win32 implementation.
|
|
28
|
+
* Defaults to process.env.PATHEXT
|
|
29
|
+
*/
|
|
30
|
+
pathExt?: string;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;IAEtB;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,GAAG,CAAC,EAAE,MAAM,CAAA;IAEZ;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAEjB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../src/options.ts"],"names":[],"mappings":"","sourcesContent":["export interface IsexeOptions {\n /**\n * Ignore errors arising from attempting to get file access status\n * Note that EACCES is always ignored, because that just means\n * it's not executable. If this is not set, then attempting to check\n * the executable-ness of a nonexistent file will raise ENOENT, for\n * example.\n */\n ignoreErrors?: boolean\n\n /**\n * effective uid when checking executable mode flags on posix\n * Defaults to process.getuid()\n */\n uid?: number\n\n /**\n * effective gid when checking executable mode flags on posix\n * Defaults to process.getgid()\n */\n gid?: number\n\n /**\n * effective group ID list to use when checking executable mode flags\n * on posix\n * Defaults to process.getgroups()\n */\n groups?: number[]\n\n /**\n * The ;-delimited path extension list for win32 implementation.\n * Defaults to process.env.PATHEXT\n */\n pathExt?: string\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the Posix implementation of isexe, which uses the file
|
|
3
|
+
* mode and uid/gid values.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { IsexeOptions } from './options.js';
|
|
8
|
+
/**
|
|
9
|
+
* Determine whether a path is executable according to the mode and
|
|
10
|
+
* current (or specified) user and group IDs.
|
|
11
|
+
*/
|
|
12
|
+
export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronously determine whether a path is executable according to
|
|
15
|
+
* the mode and current (or specified) user and group IDs.
|
|
16
|
+
*/
|
|
17
|
+
export declare const sync: (path: string, options?: IsexeOptions) => boolean;
|
|
18
|
+
//# sourceMappingURL=posix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posix.d.ts","sourceRoot":"","sources":["../../src/posix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C;;;GAGG;AACH,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,UAAS,YAAiB,KACzB,OAAO,CAAC,OAAO,CASjB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,MAAM,EACZ,UAAS,YAAiB,KACzB,OASF,CAAA"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the Posix implementation of isexe, which uses the file
|
|
3
|
+
* mode and uid/gid values.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { statSync } from 'node:fs';
|
|
8
|
+
import { stat } from 'node:fs/promises';
|
|
9
|
+
/**
|
|
10
|
+
* Determine whether a path is executable according to the mode and
|
|
11
|
+
* current (or specified) user and group IDs.
|
|
12
|
+
*/
|
|
13
|
+
export const isexe = async (path, options = {}) => {
|
|
14
|
+
const { ignoreErrors = false } = options;
|
|
15
|
+
try {
|
|
16
|
+
return checkStat(await stat(path), options);
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
const er = e;
|
|
20
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
21
|
+
return false;
|
|
22
|
+
throw er;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Synchronously determine whether a path is executable according to
|
|
27
|
+
* the mode and current (or specified) user and group IDs.
|
|
28
|
+
*/
|
|
29
|
+
export const sync = (path, options = {}) => {
|
|
30
|
+
const { ignoreErrors = false } = options;
|
|
31
|
+
try {
|
|
32
|
+
return checkStat(statSync(path), options);
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
const er = e;
|
|
36
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
37
|
+
return false;
|
|
38
|
+
throw er;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
|
|
42
|
+
const checkMode = (stat, options) => {
|
|
43
|
+
const myUid = options.uid ?? process.getuid?.();
|
|
44
|
+
const myGroups = options.groups ?? process.getgroups?.() ?? [];
|
|
45
|
+
const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
|
|
46
|
+
if (myUid === undefined || myGid === undefined) {
|
|
47
|
+
throw new Error('cannot get uid or gid');
|
|
48
|
+
}
|
|
49
|
+
const groups = new Set([myGid, ...myGroups]);
|
|
50
|
+
const mod = stat.mode;
|
|
51
|
+
const uid = stat.uid;
|
|
52
|
+
const gid = stat.gid;
|
|
53
|
+
const u = parseInt('100', 8);
|
|
54
|
+
const g = parseInt('010', 8);
|
|
55
|
+
const o = parseInt('001', 8);
|
|
56
|
+
const ug = u | g;
|
|
57
|
+
return !!(mod & o ||
|
|
58
|
+
(mod & g && groups.has(gid)) ||
|
|
59
|
+
(mod & u && uid === myUid) ||
|
|
60
|
+
(mod & ug && myUid === 0));
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=posix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posix.js","sourceRoot":"","sources":["../../src/posix.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAS,QAAQ,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAGvC;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EACxB,IAAY,EACZ,UAAwB,EAAE,EACR,EAAE;IACpB,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,OAAO,CAAA;IACxC,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,EA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CAAC;IAED,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,CAAC,CAAA;IAE5C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAA;IACrB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;IACpB,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAA;IAEpB,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC5B,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC5B,MAAM,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAA;IAC5B,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,CAAA;IAEhB,OAAO,CAAC,CAAC,CACP,GAAG,GAAG,CAAC;QACP,CAAC,GAAG,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAC5B,CAAC,GAAG,GAAG,CAAC,IAAI,GAAG,KAAK,KAAK,CAAC;QAC1B,CAAC,GAAG,GAAG,EAAE,IAAI,KAAK,KAAK,CAAC,CAAC,CAC1B,CAAA;AACH,CAAC,CAAA","sourcesContent":["/**\n * This is the Posix implementation of isexe, which uses the file\n * mode and uid/gid values.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\n\n/**\n * Determine whether a path is executable according to the mode and\n * current (or specified) user and group IDs.\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable according to\n * the mode and current (or specified) user and group IDs.\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkStat = (stat: Stats, options: IsexeOptions) =>\n stat.isFile() && checkMode(stat, options)\n\nconst checkMode = (stat: Stats, options: IsexeOptions) => {\n const myUid = options.uid ?? process.getuid?.()\n const myGroups = options.groups ?? process.getgroups?.() ?? []\n const myGid = options.gid ?? process.getgid?.() ?? myGroups[0]\n if (myUid === undefined || myGid === undefined) {\n throw new Error('cannot get uid or gid')\n }\n\n const groups = new Set([myGid, ...myGroups])\n\n const mod = stat.mode\n const uid = stat.uid\n const gid = stat.gid\n\n const u = parseInt('100', 8)\n const g = parseInt('010', 8)\n const o = parseInt('001', 8)\n const ug = u | g\n\n return !!(\n mod & o ||\n (mod & g && groups.has(gid)) ||\n (mod & u && uid === myUid) ||\n (mod & ug && myUid === 0)\n )\n}\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the Windows implementation of isexe, which uses the file
|
|
3
|
+
* extension and PATHEXT setting.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { IsexeOptions } from './options.js';
|
|
8
|
+
/**
|
|
9
|
+
* Determine whether a path is executable based on the file extension
|
|
10
|
+
* and PATHEXT environment variable (or specified pathExt option)
|
|
11
|
+
*/
|
|
12
|
+
export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
|
|
13
|
+
/**
|
|
14
|
+
* Synchronously determine whether a path is executable based on the file
|
|
15
|
+
* extension and PATHEXT environment variable (or specified pathExt option)
|
|
16
|
+
*/
|
|
17
|
+
export declare const sync: (path: string, options?: IsexeOptions) => boolean;
|
|
18
|
+
//# sourceMappingURL=win32.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"win32.d.ts","sourceRoot":"","sources":["../../src/win32.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAG3C;;;GAGG;AACH,eAAO,MAAM,KAAK,GAChB,MAAM,MAAM,EACZ,UAAS,YAAiB,KACzB,OAAO,CAAC,OAAO,CASjB,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,GACf,MAAM,MAAM,EACZ,UAAS,YAAiB,KACzB,OASF,CAAA"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This is the Windows implementation of isexe, which uses the file
|
|
3
|
+
* extension and PATHEXT setting.
|
|
4
|
+
*
|
|
5
|
+
* @module
|
|
6
|
+
*/
|
|
7
|
+
import { statSync } from 'node:fs';
|
|
8
|
+
import { stat } from 'node:fs/promises';
|
|
9
|
+
import { delimiter } from 'node:path';
|
|
10
|
+
/**
|
|
11
|
+
* Determine whether a path is executable based on the file extension
|
|
12
|
+
* and PATHEXT environment variable (or specified pathExt option)
|
|
13
|
+
*/
|
|
14
|
+
export const isexe = async (path, options = {}) => {
|
|
15
|
+
const { ignoreErrors = false } = options;
|
|
16
|
+
try {
|
|
17
|
+
return checkStat(await stat(path), path, options);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
const er = e;
|
|
21
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
22
|
+
return false;
|
|
23
|
+
throw er;
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* Synchronously determine whether a path is executable based on the file
|
|
28
|
+
* extension and PATHEXT environment variable (or specified pathExt option)
|
|
29
|
+
*/
|
|
30
|
+
export const sync = (path, options = {}) => {
|
|
31
|
+
const { ignoreErrors = false } = options;
|
|
32
|
+
try {
|
|
33
|
+
return checkStat(statSync(path), path, options);
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
const er = e;
|
|
37
|
+
if (ignoreErrors || er.code === 'EACCES')
|
|
38
|
+
return false;
|
|
39
|
+
throw er;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
const checkPathExt = (path, options) => {
|
|
43
|
+
const { pathExt = process.env.PATHEXT || '' } = options;
|
|
44
|
+
const peSplit = pathExt.split(delimiter);
|
|
45
|
+
if (peSplit.indexOf('') !== -1) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
for (const pes of peSplit) {
|
|
49
|
+
const p = pes.toLowerCase();
|
|
50
|
+
const ext = path.substring(path.length - p.length).toLowerCase();
|
|
51
|
+
if (p && ext === p) {
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return false;
|
|
56
|
+
};
|
|
57
|
+
const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);
|
|
58
|
+
//# sourceMappingURL=win32.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"win32.js","sourceRoot":"","sources":["../../src/win32.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAS,QAAQ,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AAEvC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,KAAK,EACxB,IAAY,EACZ,UAAwB,EAAE,EACR,EAAE;IACpB,MAAM,EAAE,YAAY,GAAG,KAAK,EAAE,GAAG,OAAO,CAAA;IACxC,IAAI,CAAC;QACH,OAAO,SAAS,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,MAAM,EAAE,GAAG,CAA0B,CAAA;QACrC,IAAI,YAAY,IAAI,EAAE,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,KAAK,CAAA;QACtD,MAAM,EAAE,CAAA;IAC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AAY,EAAE,OAAqB,EAAE,EAAE,CACrE,IAAI,CAAC,MAAM,EAAE,IAAI,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA","sourcesContent":["/**\n * This is the Windows implementation of isexe, which uses the file\n * extension and PATHEXT setting.\n *\n * @module\n */\n\nimport { Stats, statSync } from 'node:fs'\nimport { stat } from 'node:fs/promises'\nimport { IsexeOptions } from './options.js'\nimport { delimiter } from 'node:path'\n\n/**\n * Determine whether a path is executable based on the file extension\n * and PATHEXT environment variable (or specified pathExt option)\n */\nexport const isexe = async (\n path: string,\n options: IsexeOptions = {},\n): Promise<boolean> => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(await stat(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\n/**\n * Synchronously determine whether a path is executable based on the file\n * extension and PATHEXT environment variable (or specified pathExt option)\n */\nexport const sync = (\n path: string,\n options: IsexeOptions = {},\n): boolean => {\n const { ignoreErrors = false } = options\n try {\n return checkStat(statSync(path), path, options)\n } catch (e) {\n const er = e as NodeJS.ErrnoException\n if (ignoreErrors || er.code === 'EACCES') return false\n throw er\n }\n}\n\nconst checkPathExt = (path: string, options: IsexeOptions) => {\n const { pathExt = process.env.PATHEXT || '' } = options\n const peSplit = pathExt.split(delimiter)\n if (peSplit.indexOf('') !== -1) {\n return true\n }\n\n for (const pes of peSplit) {\n const p = pes.toLowerCase()\n const ext = path.substring(path.length - p.length).toLowerCase()\n\n if (p && ext === p) {\n return true\n }\n }\n return false\n}\n\nconst checkStat = (stat: Stats, path: string, options: IsexeOptions) =>\n stat.isFile() && checkPathExt(path, options)\n"]}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "isexe",
|
|
3
|
+
"version": "3.1.5",
|
|
4
|
+
"description": "Minimal module to check if a file is executable.",
|
|
5
|
+
"main": "./dist/commonjs/index.min.js",
|
|
6
|
+
"module": "./dist/esm/index.min.js",
|
|
7
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"tshy": {
|
|
12
|
+
"selfLink": false,
|
|
13
|
+
"exports": {
|
|
14
|
+
"./raw": "./src/index.ts",
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"import": {
|
|
18
|
+
"types": "./dist/esm/index.d.ts",
|
|
19
|
+
"default": "./dist/esm/index.min.js"
|
|
20
|
+
},
|
|
21
|
+
"require": {
|
|
22
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
23
|
+
"default": "./dist/commonjs/index.min.js"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"exports": {
|
|
29
|
+
"./raw": {
|
|
30
|
+
"import": {
|
|
31
|
+
"types": "./dist/esm/index.d.ts",
|
|
32
|
+
"default": "./dist/esm/index.js"
|
|
33
|
+
},
|
|
34
|
+
"require": {
|
|
35
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
36
|
+
"default": "./dist/commonjs/index.js"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"./package.json": "./package.json",
|
|
40
|
+
".": {
|
|
41
|
+
"import": {
|
|
42
|
+
"types": "./dist/esm/index.d.ts",
|
|
43
|
+
"default": "./dist/esm/index.min.js"
|
|
44
|
+
},
|
|
45
|
+
"require": {
|
|
46
|
+
"types": "./dist/commonjs/index.d.ts",
|
|
47
|
+
"default": "./dist/commonjs/index.min.js"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^25.2.1",
|
|
53
|
+
"esbuild": "^0.27.3",
|
|
54
|
+
"prettier": "^3.8.1",
|
|
55
|
+
"tap": "^21.5.1",
|
|
56
|
+
"tshy": "^3.1.3",
|
|
57
|
+
"typedoc": "^0.28.16"
|
|
58
|
+
},
|
|
59
|
+
"scripts": {
|
|
60
|
+
"preversion": "npm test",
|
|
61
|
+
"postversion": "npm publish",
|
|
62
|
+
"prepublishOnly": "git push origin --follow-tags",
|
|
63
|
+
"prepare": "tshy && bash build.sh",
|
|
64
|
+
"pretest": "npm run prepare",
|
|
65
|
+
"presnap": "npm run prepare",
|
|
66
|
+
"test": "tap",
|
|
67
|
+
"snap": "tap",
|
|
68
|
+
"format": "prettier --write .",
|
|
69
|
+
"typedoc": "typedoc"
|
|
70
|
+
},
|
|
71
|
+
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
72
|
+
"license": "BlueOak-1.0.0",
|
|
73
|
+
"repository": "https://github.com/isaacs/isexe",
|
|
74
|
+
"engines": {
|
|
75
|
+
"node": ">=18"
|
|
76
|
+
},
|
|
77
|
+
"type": "module"
|
|
78
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2018 Terkel Gjervig Nielsen
|
|
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.
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sisteransi",
|
|
3
|
+
"version": "1.0.5",
|
|
4
|
+
"description": "ANSI escape codes for some terminal swag",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": {
|
|
8
|
+
"name": "Terkel Gjervig",
|
|
9
|
+
"email": "terkel@terkel.com",
|
|
10
|
+
"url": "https://terkel.com"
|
|
11
|
+
},
|
|
12
|
+
"scripts": {
|
|
13
|
+
"test": "tape test/*.js | tap-spec"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/terkelg/sisteransi"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"src"
|
|
21
|
+
],
|
|
22
|
+
"types": "./src/sisteransi.d.ts",
|
|
23
|
+
"keywords": [
|
|
24
|
+
"ansi",
|
|
25
|
+
"escape codes",
|
|
26
|
+
"escape",
|
|
27
|
+
"terminal",
|
|
28
|
+
"style"
|
|
29
|
+
],
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"tap-spec": "^5.0.0",
|
|
32
|
+
"tape": "^4.13.2"
|
|
33
|
+
}
|
|
34
|
+
}
|