{"name":"@tapjs/chdir","version":"3.3.2","keywords":["tapjs plugin"],"author":{"name":"Isaac Z. Schlueter"},"license":"BlueOak-1.0.0","_id":"@tapjs/chdir@3.3.2","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"isaacs","email":"i@izs.me"}],"homepage":"https://github.com/tapjs/tapjs/src/chdir#readme","bugs":{"url":"https://github.com/tapjs/tapjs/issues"},"tap":{"typecheck":false},"dist":{"shasum":"3bbc1c8d61fba72cc50b6161605a2820b02ffd07","tarball":"http://registry-npm.ywwl.com/@tapjs/chdir/download/@tapjs/chdir-3.3.2.tgz","fileCount":13,"integrity":"sha512-V0bQhVQeffgCahuCnVQe2WiYMFCS+YRJhccIh78PH4nTyAF2EZGLBGwS7uFhLuTDPrnHH+3W/F3uqoXQq51QDA==","signatures":[{"sig":"MEUCIBOuxh7eCoeRXKZkPT2CWHaiylqukAVXgdS3VIoIxontAiEArG+H6xeIbdnCNLizrNdxfnWcNHv7ysfZEufTAx2mvYo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":11714,"size":3424,"noattachment":false,"key":"/@tapjs/chdir/-/@tapjs/chdir-3.3.2.tgz"},"main":"./dist/commonjs/index.js","tshy":{"main":true,"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":"20 || >=22"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"1071a05d25219572d6166516b3af15d16b26b09a","scripts":{"snap":"tap","test":"tap","format":"prettier --write . --log-level warn --ignore-path ../../.prettierignore --cache","prepare":"tshy","presnap":"npm run prepare","pretest":"npm run prepare","typedoc":"typedoc --tsconfig tsconfig/esm.json ./src/*.ts"},"_npmUser":{"name":"isaacs","email":"i@izs.me"},"repository":{"url":"git+ssh://git@github.com/tapjs/tapjs.git","path":"src/chdir","type":"git"},"_npmVersion":"11.10.0","description":"a built-in tap extension for t.chdir()","directories":{},"_nodeVersion":"25.6.1","_hasShrinkwrap":false,"peerDependencies":{"@tapjs/core":"4.5.0"},"_npmOperationalInternal":{"tmp":"tmp/chdir_3.3.2_1771451114706_0.5045792158172833","host":"s3://npm-registry-packages-npm-production"},"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":1771451114867,"_cnpm_publish_time":1771451114867,"dist-tags":{"latest":"3.3.13"}}