{"name":"tshy-after","version":"1.4.1","description":"Auto set package.json after tshy run","bin":{"tshy-after":"dist/esm/index.js"},"scripts":{"test":"tshy && egg-bin test","ci":"tshy && egg-bin cov","prepublishOnly":"tshy && node ./dist/esm/index.js"},"repository":{"type":"git","url":"git+ssh://git@github.com/node-modules/tshy-after.git"},"keywords":["tshy"],"author":{"name":"fengmk2"},"license":"MIT","bugs":{"url":"https://github.com/node-modules/tshy-after/issues"},"homepage":"https://github.com/node-modules/tshy-after#readme","devDependencies":{"@types/mocha":"^10.0.1","@types/node":"^22.10.2","coffee":"^5.5.0","egg-bin":"^6.5.2","tshy":"^3.0.2"},"type":"module","tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.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"}}},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","_id":"tshy-after@1.4.1","gitHead":"b06d9c8bfdf7052ae9280452c154ed42696f1794","_nodeVersion":"20.18.2","_npmVersion":"10.8.2","dist":{"integrity":"sha512-EVUiYSR59AGOy8I8eElVYKlR5bK/7ufAOv3H190HNu3sc9f3CP6Dn5QQfPIYzvg3kCt88NkTwx7n+xR8AQCCmw==","shasum":"5278148a1bc175538bdde21274200c1a57623c4f","tarball":"http://registry-npm.ywwl.com/tshy-after/download/tshy-after-1.4.1.tgz","fileCount":11,"unpackedSize":28747,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tshy-after@1.4.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIFJxrlc0+/qnvrdTUKe2g9HlZIz4EJgPk2LPsxQ3pTfZAiALKPA/nRmvtaTl6diI/TfGkAJLuRrWu9mIHS55Vipxyw=="}],"size":4882,"noattachment":false,"key":"/tshy-after/-/tshy-after-1.4.1.tgz"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"directories":{},"maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tshy-after_1.4.1_1738472383887_0.1657421489366091"},"_hasShrinkwrap":false,"readme":"# tshy-after\n\n[![NPM version][npm-image]][npm-url]\n[![Node.js CI](https://github.com/node-modules/tshy-after/actions/workflows/nodejs.yml/badge.svg)](https://github.com/node-modules/tshy-after/actions/workflows/nodejs.yml)\n[![npm download][download-image]][download-url]\n[![Node.js Version](https://img.shields.io/node/v/tshy-after.svg?style=flat)](https://nodejs.org/en/download/)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](https://makeapullrequest.com)\n\n[npm-image]: https://img.shields.io/npm/v/tshy-after.svg?style=flat-square\n[npm-url]: https://npmjs.org/package/tshy-after\n[download-image]: https://img.shields.io/npm/dm/tshy-after.svg?style=flat-square\n[download-url]: https://npmjs.org/package/tshy-after\n\nAuto set package.json after [tshy](https://github.com/isaacs/tshy) run\n\n## keep `types`\n\nSet `package.types` to `package.exports['.'].require.types`\n\n## Auto fix `import.meta.url` and `import.meta.resolve` SyntaxError on CJS\n\n```bash\nSyntaxError: Cannot use 'import.meta' outside a module\n```\n\ne.g.: Get the file's dirname\n\n```ts\n// src/index.ts\n\nimport { fileURLToPath } from 'node:url';\nimport path from 'node:path';\n\nexport function getDirname() {\n  if (typeof __dirname !== 'undefined') {\n    return __dirname;\n  }\n  // @ts-ignore\n  return path.dirname(fileURLToPath(import.meta.url));\n}\n```\n\n## License\n\n[MIT](LICENSE)\n\n## Contributors\n\n[![Contributors](https://contrib.rocks/image?repo=node-modules/tshy-after)](https://github.com/node-modules/tshy-after/graphs/contributors)\n\nMade with [contributors-img](https://contrib.rocks).\n","publish_time":1738472384052,"_cnpm_publish_time":1738472384052,"dist-tags":{"latest":"1.4.1"}}