{"id":19868210,"url":"https://github.com/klzns/parse-es6-imports","last_synced_at":"2026-03-15T14:08:54.920Z","repository":{"id":49816337,"uuid":"84769934","full_name":"klzns/parse-es6-imports","owner":"klzns","description":"Parse ES6 imports from a string","archived":false,"fork":false,"pushed_at":"2019-06-13T22:50:46.000Z","size":6,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T08:30:03.934Z","etag":null,"topics":["import","imports","javascript","parser"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/klzns.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-13T01:07:43.000Z","updated_at":"2022-07-26T21:51:21.000Z","dependencies_parsed_at":"2022-09-13T20:53:41.204Z","dependency_job_id":null,"html_url":"https://github.com/klzns/parse-es6-imports","commit_stats":null,"previous_names":["brenoc/parse-es6-imports"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klzns%2Fparse-es6-imports","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klzns%2Fparse-es6-imports/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klzns%2Fparse-es6-imports/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/klzns%2Fparse-es6-imports/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/klzns","download_url":"https://codeload.github.com/klzns/parse-es6-imports/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224301409,"owners_count":17288908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["import","imports","javascript","parser"],"created_at":"2024-11-12T15:32:46.283Z","updated_at":"2026-03-15T14:08:49.888Z","avatar_url":"https://github.com/klzns.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# parse-es6-imports [![Build Status](https://travis-ci.org/brenoc/parse-es6-imports.svg?branch=master)](https://travis-ci.org/brenoc/parse-es6-imports)\n\n\u003e Parse ES6 imports from a string\n\n## Install\n\n```sh\n$ npm install parse-es6-imports --save\n```\n\n### Usage\n\n```js\nconst parseImports = require('parse-es6-imports')\n\nconst code = `\n  import defaultA from './moduleA'\n  import defaultB, { namedB } from './moduleB'\n  import { namedC } from './moduleC'\n  import { namedD as otherName } from './moduleD'\n  import * as moduleE from './moduleE'\n  import './moduleF'\n`\n\nconst result = parseImports(code)\n\nconsole.log(JSON.stringify(result, null, 2))\n\n// [\n//   {\n//     \"defaultImport\": \"defaultA\",\n//     \"namedImports\": [],\n//     \"starImport\": null,\n//     \"fromModule\": \"./moduleA\"\n//   },\n//   {\n//     \"defaultImport\": \"defaultB\",\n//     \"namedImports\": [\n//       {\n//         \"name\": \"namedB\",\n//         \"value\": \"namedB\"\n//       }\n//     ],\n//     \"starImport\": null,\n//     \"fromModule\": \"./moduleB\"\n//   },\n//   {\n//     \"defaultImport\": null,\n//     \"namedImports\": [\n//       {\n//         \"name\": \"namedC\",\n//         \"value\": \"namedC\"\n//       }\n//     ],\n//     \"starImport\": null,\n//     \"fromModule\": \"./moduleC\"\n//   },\n//   {\n//     \"defaultImport\": null,\n//     \"namedImports\": [\n//       {\n//         \"name\": \"namedD\",\n//         \"value\": \"otherName\"\n//       }\n//     ],\n//     \"starImport\": null,\n//     \"fromModule\": \"./moduleD\"\n//   },\n//   {\n//     \"defaultImport\": null,\n//     \"namedImports\": [],\n//     \"starImport\": \"moduleE\",\n//     \"fromModule\": \"./moduleE\"\n//   },\n//   {\n//     \"defaultImport\": null,\n//     \"namedImports\": [],\n//     \"starImport\": null,\n//     \"fromModule\": \"./moduleF\"\n//   }\n// ]\n```\n\n## License\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklzns%2Fparse-es6-imports","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fklzns%2Fparse-es6-imports","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fklzns%2Fparse-es6-imports/lists"}