open-index/open-npm huggingface dataset:
npm package: @swwind/find-exports
Description: **This module is ESM only**
Latest version: 2.0.0

# @swwind/find-exports

**This module is ESM only**

Find exports which matches the following pattern.

```js
export const name1 = func1(/* ... */);
export const name2 = func2(/* ... */);
```

where callee names (`func1` and `func2`) can be specified.

## Example

```ts
import { parse } from "@swc/core";
import { find } from "@swwind/find-exports";

const code = `
export const one = loader$(() => { return true; });
export let two = action$(() => { return false; });
export var the = loader$(() => { return false; });

// below may works, but will not match
const none = loader$(() => {}); export { none };
export const none = (0, loader$)(() => {});
export const [none = loader$(() => {})] = [];
`;

const program = await parse(code);
const found = find(program, ["loader$", "action$"]);
// => found = [
// =>   { callee: "loader$", name: "one" },
// =>   { callee: "action$", name: "two" },
// =>   { callee: "loader$", name: "the" },
// => ]
```
npm package: @swwind/get-exports
Description: **This module is ESM only**
Latest version: 2.0.0

# @swwind/get-exports

**This module is ESM only**

Get ES Module exports using [SWC](https://swc.rs/) AST.

# Example

```ts
import { parse } from "@swc/core";
import { get } from "@swwind/get-exports";

const program = await parse(
  `
  export const foo: number = 2333;
  export { foo as "😅" };
  export default () => {};
  `,
  { syntax: "typescript" }
);
const exports = get(program);
// exports = [
//   { type: "ident", name: "foo" },
//   { type: "str", name: "😅" },
//   { type: "default" },
// ]
```