Skip to content

Conversation

@AndersDJohnson
Copy link
Contributor

@AndersDJohnson AndersDJohnson commented Jul 16, 2022

Supports dependents/node-dependency-tree#147.

Support passing an option identifiers: true to return imported identifiers in addition to paths.

For named imports or re-exports like this:

import { one, two } from 'whatever';

// or

export { one, two } from 'whatever';

The result will then look like this:

[
  { path: 'whatever', identifiers: ['one', 'two'] }
]

instead of just this:

['whatever']

In the case of default exports like:

import foo from 'whatever';

We'll return:

{ path: 'whatever', identifiers: ['default'] }

In cases of import or re-export all, or dynamic imports, or where we otherwise just can't determine, like:

import * from 'whatever';

// or

export * from 'whatever';

// or

import('whatever').then(/* ... */);

We'll return:

{ path: 'whatever', identifiers: ['*'] }

@AndersDJohnson AndersDJohnson changed the title feat: tokens feat: identifiers Jul 16, 2022
@AndersDJohnson
Copy link
Contributor Author

closing since upstream issue dependents/node-dependency-tree#147 was closed, to be replaced by #48 perhaps

@AndersDJohnson AndersDJohnson deleted the tokens branch October 2, 2022 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant