{"name":"@putout/plugin-esm","version":"4.1.1","keywords":["putout","putout-plugin","plugin","esm"],"author":{"url":"https://github.com/coderaiser","name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"license":"MIT","_id":"@putout/plugin-esm@4.1.1","maintainers":[{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"}],"homepage":"https://github.com/coderaiser/putout/tree/master/packages/plugin-esm#readme","bugs":{"url":"https://github.com/coderaiser/putout/issues"},"tag":false,"dist":{"shasum":"bdf06adf27d348aebe853d36118e65fdbdb849b4","tarball":"http://registry-npm.ywwl.com/@putout/plugin-esm/download/@putout/plugin-esm-4.1.1.tgz","fileCount":19,"integrity":"sha512-egCNH+WJRP0qLU3uAq0F9xfJytssAdjgyTH76gEOZTJZ/xmQXyIfLT0iAXLPzkOHuWC08Yi+o3n/ilmR64GKpg==","signatures":[{"sig":"MEYCIQCDn9zGJwzLlS9SGfkxbJ0EtjMLlCof6zUGeRJqbCDBrgIhAMAc/bixx285lnJKqBz4dXcNS8IZBtkmKY4gUIPZwqoW","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29246,"size":8197,"noattachment":false,"key":"/@putout/plugin-esm/-/@putout/plugin-esm-4.1.1.tgz"},"main":"lib/index.js","type":"module","engines":{"node":">=20"},"exports":{".":"./lib/index.js","./merge-duplicate-imports":"./lib/merge-duplicate-imports/index.js"},"gitHead":"9b18c72322e941a676b585dbbec373ceeb0b7744","release":false,"scripts":{"lint":"madrun lint","test":"madrun test","report":"madrun report","coverage":"madrun coverage","fix:lint":"madrun fix:lint","fresh:lint":"madrun fresh:lint","lint:fresh":"madrun lint:fresh","watch:test":"madrun watch:test"},"_npmUser":{"name":"coderaiser","email":"mnemonic.enemy@gmail.com"},"changelog":false,"repository":{"url":"git+https://github.com/coderaiser/putout.git","type":"git"},"_npmVersion":"11.1.0","description":"🐊Putout plugin improves ability to transform ESM code","directories":{},"_nodeVersion":"20.19.0","dependencies":{"parse-import-specifiers":"^1.0.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.0.0","eslint":"^9.0.0","madrun":"^11.0.0","montag":"^1.2.1","nodemon":"^3.0.1","supertape":"^11.0.3","@putout/test":"^13.0.0","eslint-plugin-n":"^17.0.0","@putout/eslint-flat":"^3.0.0","@putout/plugin-tape":"*","eslint-plugin-putout":"^26.0.0","@putout/plugin-nodejs":"*","@putout/plugin-putout":"*","@putout/plugin-declare":"*","@putout/plugin-typescript":"*","@putout/plugin-reuse-duplicate-init":"*","@putout/plugin-declare-before-reference":"*"},"peerDependencies":{"putout":">=40"},"_npmOperationalInternal":{"tmp":"tmp/plugin-esm_4.1.1_1744232313264_0.6722211701396432","host":"s3://npm-registry-packages-npm-production"},"readme":"# @putout/plugin-esm [![NPM version][NPMIMGURL]][NPMURL]\n\n[NPMIMGURL]: https://img.shields.io/npm/v/@putout/plugin-esm.svg?style=flat&longCache=true\n[NPMURL]: https://npmjs.org/package/@putout/plugin-esm \"npm\"\n\n> The static `import` statement is used to `import` read only live bindings which are exported by another module.\n> The imported bindings are called live bindings because they are updated by the module that exported the binding, but cannot be re-assigned by the importing module.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)\n\n🐊[**Putout**](https://github.com/coderaiser/putout) plugin adds ability to transform to new **Node.js** API and apply best practices.\n\n## Install\n\n```\nnpm i putout @putout/plugin-esm -D\n```\n\n## Rules\n\n- ✅ [apply-default-import](#apply-default-import);\n- ✅ [apply-export-from](#apply-export-from);\n- ✅ [apply-import-import](#apply-import-attributes);\n- ✅ [convert-assert-to-with](#convert-assert-to-with);\n- ✅ [convert-const-to-import](#convert-const-to-import);\n- ✅ [declare-imports-first](#declare-imports-first);\n- ✅ [group-imports-by-source](#group-imports-by-source);\n- ✅ [merge-declaration-with-export](#merge-declaration-with-export);\n- ✅ [merge-duplicate-imports](#merge-duplicate-imports);\n- ✅ [merge-export-declarations](#merge-export-declarations);\n- ✅ [remove-empty-export](#remove-empty-export);\n- ✅ [remove-empty-import](#remove-empty-import);\n- ✅ [remove-imports-with-duplicate-source](#remove-imports-with-duplicate-source);\n- ✅ [remove-quotes-from-import-assertions](#remove-quotes-from-import-assertions);\n- ✅ [remove-useless-export-specifiers](#remove-useless-export-specifiers);\n- ✅ [sort-imports-by-specifiers](#sort-imports-by-specifiers);\n\n## File rules\n\n- ✅ [apply-js-to-imported-file](#apply-js-to-imported-file);\n- ✅ [apply-name-to-imported-file](#apply-name-to-imported-file);\n- ✅ [apply-namespace-to-imported-file](#apply-namespace-to-imported-file);\n- ✅ [apply-privately-imported-file](#apply-privately-imported-file);\n- ✅ [resolve-imported-file](#resolve-imported-file);\n- ✅ [resolve-imported-file-with-extension](#resolve-imported-file-with-extension);\n- ✅ [shorten-imported-file](#shorten-imported-file);\n\n## Config\n\n```json\n{\n    \"rules\": {\n        \"esm/apply-default-import\": \"on\",\n        \"esm/apply-export-from\": \"on\",\n        \"esm/apply-import-attirbutes\": \"on\",\n        \"esm/apply-js-to-imported-file\": \"off\",\n        \"esm/apply-name-to-imported-file\": \"off\",\n        \"esm/apply-namespace-to-imported-file\": \"off\",\n        \"esm/apply-privately-imported-file\": \"off\",\n        \"esm/convert-assert-to-with\": \"on\",\n        \"esm/convert-const-to-import\": \"on\",\n        \"esm/declare-imports-first\": \"on\",\n        \"esm/group-imports-by-source\": \"on\",\n        \"esm/merge-declaration-with-export\": \"on\",\n        \"esm/merge-duplicate-imports\": \"on\",\n        \"esm/merge-export-declaration\": \"on\",\n        \"esm/remove-empty-export\": \"on\",\n        \"esm/remove-empty-import\": [\"on\", {\n            \"ignore\": []\n        }],\n        \"esm/remove-imports-with-duplicate-source\": \"on\",\n        \"esm/remove-quotes-from-import-assertions\": \"on\",\n        \"esm/remove-useless-export-specifiers\": \"off\",\n        \"esm/resolve-imported-file\": \"off\",\n        \"esm/resolve-imported-file-with-extension\": \"off\",\n        \"esm/shorten-imported-file\": \"off\",\n        \"esm/sort-imports-by-specifiers\": \"on\",\n        \"esm/remove-useless-slash\": \"on\"\n    }\n}\n```\n\n## Rules\n\n### apply-default-import\n\n> The static `import` declaration is used to import read-only live bindings which are exported by another module.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import)\n\nCheck out 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/83dcc8478ac794cbe11df41a80a08cbe/8270019356b6f8ea21233d6eb1edccec69e708bb).\n\n#### ❌ Example of incorrect code\n\n```js\nimport {default as a} from 'a';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport a from 'a';\n```\n\n### apply-export-from\n\n> The `export` declaration is used to export values from a JavaScript module.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export)\n\nCheck out 🐊**Putout Editor**:\n\n- [#1](https://putout.cloudcmd.io/#/gist/c9a3983d269745da89c1c7560f3b7fac/3ecb9aa6b910ce3816605bae11c8dd86bdc457e5);\n- [#2](https://putout.cloudcmd.io/#/gist/9b2a0a51acf477291a6bbcbe7d846ddf/fa21768506f518ca0a1073beb82a9b8b8f5e7c19);\n\n#### ❌ Example of incorrect code\n\n```js\nimport * as ns_1 from 'x';\nimport {createAsyncLoader} from './load/async-loader.js';\n\nexport {\n    ns_1 as ns,\n    createAsyncLoader,\n};\n```\n\n#### ✅ Example of correct code\n\n```js\nexport * as ns from 'x';\nexport {createAsyncLoader} from './load/async-loader.js';\n```\n\n### apply-import-attributes\n\n> The **import attributes** feature instructs the runtime about how a module should be loaded, including the behavior of module resolution, fetching, parsing, and evaluation.\n>\n> (c) [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import/with)\n\nCheck out 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/d8d428c2555bacd69d530f84a41ab98e/15d41cf9153b3d2513c2bdf37d36c5276c6f6f95).\n\n#### ❌ Example of incorrect code\n\n```js\nimport a from '../package.json';\n\nexport * as x from './package.json';\n\nawait import('./package.json');\n```\n\n#### ✅ Example of correct code\n\n```js\nimport a from '../package.json' with {\n    type: 'json',\n};\n\nexport * from './package.json' with {\n    type: 'json',\n};\nawait import('./package.json', {\n    with: {\n        type: 'json',\n    },\n});\n```\n\n### merge-declaration-with-export\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/3fad517d76942d0a1f51d7f58a2799af/7a052ab18a31fa382228d6513c412be37091cfb8).\n\n#### ❌ Example of incorrect code\n\n```js\nconst stack = [];\n\nfunction sum(a, b) {\n    i32.add(local.get(), local.get());\n}\n\nexport {\n    sum,\n    stack,\n};\n```\n\n#### ✅ Example of correct code\n\n```js\nexport const stack = [];\n\nexport function sum(a, b) {\n    i32.add(local.get(), local.get());\n}\n\nexport const {\n    report,\n    fix,\n    scan,\n} = createRemoveFiles(['*.swp', '*.swo']);\n```\n\n### merge-export-declarations\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/d3e490352bd4a98033de89db670b4737/3ff4803578bf39f8587cb578a103e5d92dd92050).\n\n#### ❌ Example of incorrect code\n\n```js\nexport {\n    loadPlugins,\n};\nexport {\n    loadPluginsAsync,\n};\n```\n\n#### ❌ Example of incorrect code\n\n```js\nexport {\n    loadPlugins,\n    loadPluginsAsync,\n};\n```\n\n### remove-useless-export-specifiers\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/e5c3ea469437ade0f4467323dcec9a36/7c298c7078b004ae3aba2a29e38579bf8f48a098).\n\n```diff\nexport const hello = () => 'world';\nexport const {\n-    hello,\n}\n```\n\n### remove-imports-with-duplicate-source\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/f48250f577be00b53f923318a1d0a584/1a42dc1be8610fc35975ee397bce9fe4722b82dc).\n\n```diff\nimport * as convertCommonjsToEsm from '@putout/plugin-nodejs/convert-commonjs-to-esm';\n-import * as convert from '@putout/plugin-nodejs/convert-commonjs-to-esm';\n\ntest('putout: plugin-destructuring: merge-properties: transform: exports', (t) => {\n    t.transform('exports', {\n-       'node/convert-commonjs-to-esm': convert,\n+       'node/convert-commonjs-to-esm': convertCommonjsToEsm,\n    });\n    t.end();\n});\n```\n\n### declare-imports-first\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/b1c18e5d726afe4ebb69d6b7a7dda82b/8189590815a1b8adb35bb8a846e28228e3c7fadf). For **CommonJS** use [nodejs/declare-after-require](https://github.com/coderaiser/putout/tree/master/packages/plugin-nodejs#declare-after-require).\n\n#### ❌ Example of incorrect code\n\n```js\nconst [arg] = process.argv;\nimport esbuild from 'esbuild';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport esbuild from 'esbuild';\n\nconst [arg] = process.argv;\n```\n\n### group-imports-by-source\n\nGroup order:\n\n- ✅ builtins;\n- ✅ external;\n- ✅ hashed;\n- ✅ internal;\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/3cc782acf95211f9d456d63a99032ee1/0674223d050bba572f5271ffdccf8616cb441af5).\n\n#### ❌ Example of incorrect code\n\n```js\nimport fs from 'node:fs';\nimport {lodash} from 'lodash';\nimport react from 'react';\nimport d from '../hello.js';\nimport ss from '../../bb/ss.js';\nimport b from './ss.js';\nimport parse from '#parser';\n\nconst c = 5;\n```\n\n#### ✅ Example of correct code\n\n```js\nimport fs from 'node:fs';\nimport react from 'react';\nimport {lodash} from 'lodash';\nimport parse from '#parser';\nimport b from './ss.js';\nimport d from '../hello.js';\nimport ss from '../../bb/ss.js';\n\nconst c = 5;\n```\n\n### merge-duplicate-imports/join\n\n#### ❌ Example of incorrect code\n\n```js\nimport test from 'supertape';\nimport {stub} from 'supertape';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport test, {stub} from 'supertape';\n```\n\n### merge-duplicate-imports/rename\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/6604936dec6b1eed8ce0d143f2962f15/17b310a6e4d85b0b8615a8b91d0e27414e8af291).\nTo disable use:\n\n```json\n{\n    \"rules\": {\n        \"esm/merge-duplicate-imports-rename\": \"off\"\n    }\n}\n```\n\n#### ❌ Example of incorrect code\n\n```js\nimport putout from './putout.js';\nimport all from './putout.js';\nimport x from './putout.js';\n\nconsole.log(all);\nconsole.log(x);\n```\n\n#### ✅ Example of correct code\n\n```js\nimport putout from './putout.js';\n\nconsole.log(putout);\nconsole.log(putout);\n```\n\n### remove-empty-export\n\n```diff\n-export {};\n```\n\n### remove-empty-import\n\n```diff\n-import 'abc';\n```\n\n### remove-quotes-from-import-assertions\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/f9f34acddbefba0ded53225ca10fa44e/7b4dba44602b9b2d28fe3a98989474a4b0d8d73d).\n\n#### ❌ Example of incorrect code\n\n```js\nimport json from './mod.json' with {\n    type: 'json',\n};\n```\n\n#### ✅ Example of correct code\n\n```js\nimport json from './mod.json' with {\n    type: 'json',\n};\n```\n\n### sort-imports-by-specifiers\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/521e2ff199243a7ce1f65db7140c272e/28c0588281286f8a6765b8aa2ecabbfcde2973a7).\n\n#### ❌ Example of incorrect code\n\n```js\nimport {\n    a,\n    b,\n    c,\n    d,\n} from 'd';\nimport a1 from 'a1';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport a1 from 'a1';\nimport {\n    a,\n    b,\n    c,\n    d,\n} from 'd';\n```\n\n### convert-assert-to-with\n\n> This feature would ideally use the `with` keyword to denote attributes, but there are existing implementations based on a previous version of the proposal using the `assert` keyword. Due to potential web compatibility risks, the proposal still includes `assert` marked as deprecated. Usage of the old syntax is discouraged, and its removal is being investigated.\n>\n> (c) [tc39](https://tc39.es/proposal-import-attributes/)\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/9f85897b998c6458efc19db6a5414b79/57ef7cdd113c7a0087e0f7a6e70522f60baa04f4).\n\n#### ❌ Example of incorrect code\n\n```\nimport json from './foo.json' assert {\n    type: 'json',\n};\n\nimport('foo.json', {\n    assert: {\n        type: 'json',\n    },\n});\n```\n\n#### ✅ Example of correct code\n\n```js\nimport json from './foo.json' with {\n    type: 'json',\n};\n\nimport('foo.json', {\n    with: {\n        type: 'json',\n    },\n});\n```\n\n### convert-const-to-import\n\nCheck out in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/2682a3899fe6916e22073abf0b56b13c/f9d7ca3ddb65331bb836af78825d80fd258b3f94).\n\n#### ❌ Example of incorrect code\n\n```\nconst {Server} from 'socket.io';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport {Server} from 'socket.io';\n```\n\n## File Rules\n\n### apply-namespace-to-imported-file\n\nThe rule fixes:\n\n> `SyntaxError: The requested module './a.js' does not provide an export named 'default'`\n\nCheck out in 🐊**Putout Editor**:\n\n- ✅ [`apply-namespace-to-imported-file`](https://putout.cloudcmd.io/#/gist/1492d584559e5798325047de679222a0/c6a37a803b80823de1b64ab944f2427aecefb51b);\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/5d7687215e9fbdf705935c444503dded/75a98d2db9d3847c73017e41637924b1cfd5a598);\n- ✅ [`has-export-default`](https://putout.cloudcmd.io/#/gist/b50ccfe5cc8c0c97e2fc98b37903ade4/fbc026e6f1027581f7aa4879dcafcaa7754bf8f4);\n- ✅ [`apply-namespace-import`](https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7);\n- ✅ [`is-esm`](https://putout.cloudcmd.io/#/gist/fa080be2bf3a6560e289d84b5873c2bc/2601091f6bf97148843767968c3afcb36dde31de);\n\nLet's consider file structure:\n\n```\n/\n└── lib/\n    ├── index.js \"import a from './a.js';\"\n    └── b.js \"export const b = 2;\" \n```\n\nIn this case `index.js` can be fixed:\n\n#### ❌ Example of incorrect code\n\n```js\nimport a from './a.js';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport * as a from './a.js';\n```\n\n### apply-name-to-imported-file\n\nCheckout in 🐊**Putout Editor**:\n\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/5d7687215e9fbdf705935c444503dded/75a98d2db9d3847c73017e41637924b1cfd5a598);\n- ✅ [`has-export-default`](https://putout.cloudcmd.io/#/gist/b50ccfe5cc8c0c97e2fc98b37903ade4/fbc026e6f1027581f7aa4879dcafcaa7754bf8f4);\n- ✅ [`is-esm`](https://putout.cloudcmd.io/#/gist/fa080be2bf3a6560e289d84b5873c2bc/2601091f6bf97148843767968c3afcb36dde31de);\n\nLet's consider file structure:\n\n```\n/\n└── lib/\n    ├── index.js \"import a from './a.js';\\n export * as b from './b.js'\"\n    ├── a.js \"export const a = 2;\"\n    └── b.js \"export const b = 2;\" \n```\n\nIn this case `index.js` can be fixed:\n\n##### ❌ Example of incorrect code\n\n```js\nimport a from './a.js';\n\nexport * as b from './b.js';\n```\n\n##### ✅ Example of correct code\n\n```js\nimport {a} from './a.js';\n\nexport {b} from './b.js';\n```\n\n### apply-privately-imported-file\n\n> Entries in the imports field must be strings starting with `#`.\n> Package imports permit mapping to external packages.\n> This field defines subpath imports for the current package.\n>\n> (c) [nodejs.org](https://nodejs.org/api/packages.html#imports)\n\nCheck out in 🐊**Putout Editor**:\n\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/5d7687215e9fbdf705935c444503dded/75a98d2db9d3847c73017e41637924b1cfd5a598);\n- ✅ [`change-imports`](https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7);\n\nLet's consider file structure:\n\n```\n/\n├── package.json {\"imports\": {\"#is: {\"default\": \"./lib/tokenize/is.js\"}}}\n└──  lib/\n    └── tokenize/\n        ├── is.js \"export const isPrev = () => {}\"\n        └── expressions/\n            └── spread-element.js \"import {isPrev} from '../is.js\"\n```\n\nIn this case `spread-element.js` can be fixed:\n\n#### ❌ Example of incorrect code\n\n```js\nimport {isPrev} from '../is.js';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport {isPrev} from '#is';\n```\n\n### resolve-imported-file\n\n> `import` a directory URL is unsupported.\n>\n> (c) [nodejs.org](https://nodejs.org/api/errors.html#err_unsupported_dir_import)\n\nCheck out in 🐊**Putout Editor**:\n\n- ✅ [`resolve-imported-file`](https://putout.cloudcmd.io/#/gist/241489cb2781dd37ec96baf0115cde4e/83c2f2e9f490850b7fda432f8d25ae6a64ed07e3);\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/ee10100fed86e4db926885dd54298668/7538bca7a9ae006d976f41261c0ed4c0e1902ace);\n- ✅ [`change-imports`](https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7);\n\nLet's consider file structure:\n\n```\n/\n├── package.json\n└── lib/\n    ├── index.js\n    └── a.js\n```\n\nIn this case `index.js` can be fixed:\n\n#### ❌ Example of incorrect code\n\n```js\nimport a from './a';\nimport info from '../package';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport a from './a.js';\nimport info from '../package.json' with {\n    type: 'json',\n};\n```\n\n### resolve-imported-file-with-extension\n\nCheck out in 🐊**Putout Editor**:\n\n- ✅ [`resolve-imported-file`](https://putout.cloudcmd.io/#/gist/241489cb2781dd37ec96baf0115cde4e/83c2f2e9f490850b7fda432f8d25ae6a64ed07e3);\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/ee10100fed86e4db926885dd54298668/7538bca7a9ae006d976f41261c0ed4c0e1902ace);\n- ✅ [`change-imports`](https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7);\n\nLet's consider file structure:\n\n```\n/\n├── package.json\n└── lib/\n    ├── index.js\n    └── a.js\n```\n\nIn this case `index.js` can be fixed:\n\n#### ❌ Example of incorrect code\n\n```js\nimport a from './a.cjs';\nimport info from '../package';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport a from './a.js';\nimport info from '../package.json' with {\n    type: 'json',\n};\n```\n\n### shorten-imported-file\n\nCheck out in 🐊**Putout Editor**:\n\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/ee10100fed86e4db926885dd54298668/7538bca7a9ae006d976f41261c0ed4c0e1902ace);\n- ✅ [`change-imports`](https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7);\n\nLet's consider file structure:\n\n```\n/\n└── processors/\n    ├── index.js\n    └── parse-processor-names.js\n```\n\nIn this case `index.js` can be fixed:\n\n#### ❌ Example of incorrect code\n\n```js\nimport {parseProcessorNames} from '../processors/parse-processor-names.js';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport {parseProcessorNames} from './parse-processor-names.js';\n```\n\n### apply-js-to-imported-file\n\nCheckout in 🐊**Putout Editor**:\n\n- ✅ [`get-imports`](https://putout.cloudcmd.io/#/gist/ee10100fed86e4db926885dd54298668/7538bca7a9ae006d976f41261c0ed4c0e1902ace);\n- ✅ [`change-imports`](https://putout.cloudcmd.io/#/gist/23a6dc6741b772c03fbed95feda2b451/1fbecac6fc40282bcda0593aa666a8c213ef85b7);\n\nLet's consider file structure:\n\n```\n/\n└── lib/\n    ├── index.js\n    └── a.js\n```\n\nIn this case `index.js` can be fixed:\n\n#### ❌ Example of incorrect code\n\n```js\nimport a from './a.mjs';\n```\n\n#### ✅ Example of correct code\n\n```js\nimport a from './a.js';\n```\n\n## remove-useless-slash\n\nCheckout in 🐊[**Putout Editor**](https://putout.cloudcmd.io/#/gist/3ae86417ae3af5b5dbd3a10717668607/2a1396092ad67ca7aaacd396f50b3f6b3ae4116e).\n\n### ❌ Example of incorrect code\n\n```js\nimport * as convertLastvalToLastInsertRowid from './convert-postgres-to-sqlite//convert-lastval-to-last-insert-rowid/index.js';\n```\n\n### ✅ Example of correct code\n\n```js\nimport * as convertLastvalToLastInsertRowid from './convert-postgres-to-sqlite/convert-lastval-to-last-insert-rowid/index.js';\n```\n\n## License\n\nMIT\n","publish_time":1744232313434,"_cnpm_publish_time":1744232313434,"dist-tags":{"latest":"10.12.1"}}