{"name":"tshy-after","version":"1.1.1","keywords":["tshy"],"author":{"name":"fengmk2"},"license":"MIT","_id":"tshy-after@1.1.1","maintainers":[{"name":"fengmk2","email":"fengmk2@gmail.com"}],"homepage":"https://github.com/node-modules/tshy-after#readme","bugs":{"url":"https://github.com/node-modules/tshy-after/issues"},"bin":{"tshy-after":"dist/esm/index.js"},"dist":{"shasum":"aab8f9ce1a53a4ff220a6666a9d5320bba7b5071","tarball":"http://registry-npm.ywwl.com/tshy-after/download/tshy-after-1.1.1.tgz","fileCount":10,"integrity":"sha512-b3ul13a/OC+KTA4FryWvNfs9P/mDuLDxrT2AT06/tq2iYTWGdys0YsKVt2RcRcud2Ct9RxjnWXqFEhmCX0DtEw==","signatures":[{"sig":"MEYCIQCx/ZSYNr0MOHnvRM0yOAq/M5SqdE8fqg60i0//R/LiDgIhAPAtNASLjn1EWNc+zrMkKVngk+f9TqwrtCFA05UTf/Xp","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tshy-after@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":13241,"size":3354,"noattachment":false,"key":"/tshy-after/-/tshy-after-1.1.1.tgz"},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","source":"./src/index.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","source":"./src/index.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"a958c4219ee2b7d5068654032384f64dea68f1fc","scripts":{"ci":"tshy && egg-bin cov","test":"tshy && egg-bin test","prepublishOnly":"tshy && node ./dist/esm/index.js"},"_npmUser":{"name":"fengmk2","email":"fengmk2@gmail.com"},"repository":{"url":"git+ssh://git@github.com/node-modules/tshy-after.git","type":"git"},"_npmVersion":"10.7.0","description":"Auto set package.json after tshy run","directories":{},"_nodeVersion":"18.20.3","_hasShrinkwrap":false,"devDependencies":{"tshy":"^1.0.0","coffee":"^5.5.0","egg-bin":"^6.5.2","@types/node":"^20.6.2","@types/mocha":"^10.0.1"},"_npmOperationalInternal":{"tmp":"tmp/tshy-after_1.1.1_1720332081988_0.9709003727654992","host":"s3://npm-registry-packages"},"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":1720332082145,"_cnpm_publish_time":1720332082145,"dist-tags":{"latest":"1.4.1"}}