{"name":"tshy-after","version":"1.3.1","keywords":["tshy"],"author":{"name":"fengmk2"},"license":"MIT","_id":"tshy-after@1.3.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":"e3166d00617f96e60ce2f3895591b4371d7fdee7","tarball":"http://registry-npm.ywwl.com/tshy-after/download/tshy-after-1.3.1.tgz","fileCount":11,"integrity":"sha512-DXWtoD4o8gqk1t1lub+3cIeMHHIPh2AGGBfJkLyKa2iGOYjXlizxW4Se3qSv7ZdG1q5A/iExg94HnHaUynh9oQ==","signatures":[{"sig":"MEQCIFfA52mjobuPU0dRi7GPnmWatNVrL9/0GknMV6NkiXEkAiANpsNe9/Az54FL3+GUq005lDbCkirt2Hh1Wb7/1kt2qg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/tshy-after@1.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":23750,"size":4432,"noattachment":false,"key":"/tshy-after/-/tshy-after-1.3.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","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"gitHead":"047ce048f1c7eee88c922d8bb57cddf8b4fb6330","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.8.2","description":"Auto set package.json after tshy run","directories":{},"_nodeVersion":"18.20.5","_hasShrinkwrap":false,"devDependencies":{"tshy":"^3.0.2","coffee":"^5.5.0","egg-bin":"^6.5.2","@types/node":"^22.10.2","@types/mocha":"^10.0.1"},"_npmOperationalInternal":{"tmp":"tmp/tshy-after_1.3.1_1734879705471_0.2634562782233183","host":"s3://npm-registry-packages-npm-production"},"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":1734879705627,"_cnpm_publish_time":1734879705627,"dist-tags":{"latest":"1.4.1"}}