{"name":"@tapjs/chdir","version":"3.3.11","description":"a built-in tap extension for t.chdir()","tshy":{"main":true,"exports":{"./package.json":"./package.json",".":"./src/index.ts"},"selfLink":false},"type":"module","main":"./dist/commonjs/index.js","module":"./dist/esm/index.js","types":"./dist/commonjs/index.d.ts","exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"scripts":{"prepare":"tshy","pretest":"npm run prepare","presnap":"npm run prepare","test":"tap","snap":"tap","format":"prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache","typedoc":"typedoc --tsconfig tsconfig/esm.json ./src/*.ts"},"author":{"name":"Isaac Z. Schlueter"},"license":"BlueOak-1.0.0","peerDependencies":{"@tapjs/core":"4.5.9"},"tap":{"typecheck":false},"repository":{"type":"git","url":"git+ssh://git@github.com/tapjs/tapjs.git","path":"src/chdir"},"homepage":"https://github.com/tapjs/tapjs/tree/main/src/chdir#readme","bugs":{"url":"https://github.com/tapjs/tapjs/issues"},"keywords":["tapjs plugin"],"engines":{"node":"20 || >=22"},"gitHead":"88f4b97ec068d0ab6908f472706f57d273b32ba9","_id":"@tapjs/chdir@3.3.11","_nodeVersion":"26.5.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-k4bidoiZg90WWTs6KIOt2skdAcQ3DXExmeoj1OAyE89AlcUBCsRAbzdNmsLP5DHgh9pFYs/hnCBdcOPN4Hm75A==","shasum":"09501b49be1323f168620f7ad93ace05340fddd8","tarball":"http://registry-npm.ywwl.com/@tapjs/chdir/download/@tapjs/chdir-3.3.11.tgz","fileCount":13,"unpackedSize":11748,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIH3vpzdHtK5/U0watjDcLoUpRNK8NnQk+1eLNPdQeo8rAiAmgzSiWmfSJ8LsRT96PuZczR/4UKEG2ls7uysukVjFqQ=="}],"size":3438,"noattachment":false,"key":"/@tapjs/chdir/-/@tapjs/chdir-3.3.11.tgz"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"directories":{},"maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"isaacs","email":"i@izs.me"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/chdir_3.3.11_1785178329815_0.11429995380014635"},"_hasShrinkwrap":false,"readme":"# `@tapjs/chdir`\n\nA default tap plugin for changing the working directory for the\ncontext of a single test, and then returning to the original\nworking directory when the test is over.\n\n## Usage\n\n```js\nimport t from 'tap'\n\nt.test('using t.chdir() example', t => {\n  const dir = t.testdir({\n    'some-file.txt': 'hello',\n  })\n  t.chdir(dir)\n  t.equal(readFileSync('./some-file.txt', 'utf8'), 'hello')\n  t.equal(process.cwd(), t.testdirName)\n  // when the test ends, the original working dir is restored\n  t.end()\n})\n\n// without this plugin, you'd have to do it this way:\nt.test('without t.chdir() example', t => {\n  const dir = t.testdir({\n    'some-file.txt': 'hello',\n  })\n  const cwd = process.cwd()\n  t.teardown(() => process.chdir(cwd))\n  process.chdir(dir)\n  // run tests...\n  t.end()\n})\n```\n\n## API\n\n- `t.chdir(dir: string)` Change the process working directory to\n  the supplied path. When the test ends, the original dir is\n  restored.\n","publish_time":1785178329960,"_cnpm_publish_time":1785178329960,"dist-tags":{"latest":"3.3.13"}}