{"name":"tshy-after","version":"1.1.0","keywords":["tshy"],"author":{"name":"fengmk2"},"license":"MIT","_id":"tshy-after@1.1.0","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":"469600a5c448f4ce45b9d13270ebd6a92c6c889d","tarball":"http://registry-npm.ywwl.com/tshy-after/download/tshy-after-1.1.0.tgz","fileCount":10,"integrity":"sha512-GsbPzVv97QcGKqQuJ1ADszWtKiLysHwG2qquPDjBVqwUUfuSGs0SFZmr6rH9m14wKbk29EIsaiTJCyo+nbFhLA==","signatures":[{"sig":"MEUCIQCzntqF/ixGafabk1fxPdqR19N++zFZ5INy7DK8vMhn3QIgY9+xNUV8F7zYjiHnK1rNvwdaFdyoiHjRBGbdBn3GTFs=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tshy-after@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":11594,"size":3181,"noattachment":false,"key":"/tshy-after/-/tshy-after-1.1.0.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":"c0070edffddcf4daedd7909a4a32c990bb957ef7","scripts":{"ci":"tshy && egg-bin cov","test":"tshy && egg-bin test","prepublishOnly":"tshy"},"_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.0_1720331344838_0.5056053452926534","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":1720331344968,"_cnpm_publish_time":1720331344968,"dist-tags":{"latest":"1.4.1"}}