# @macro-plugin/shared

> macro-plugin shared utils for plugins

Latest version **1.2.1** (published 2023-06-16) · MIT license · 0 weekly downloads

## Install

```sh
npm install @macro-plugin/shared
pnpm add @macro-plugin/shared
yarn add @macro-plugin/shared
bun add @macro-plugin/shared
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2023-06-16 |
| First published | 2023-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 207.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Raven Satir |
| Maintainers | voorjaar |

## Links

- npm: https://www.npmjs.com/package/@macro-plugin/shared
- Repository: https://github.com/macro-plugin/macros
- Homepage: https://github.com/macro-plugin/macros/tree/main/packages/shared
- Issues: https://github.com/macro-plugin/macros/issues
- npm.io page: https://npm.io/package/@macro-plugin/shared

## Dependencies (1)

- [@macro-plugin/core](https://npm.io/package/@macro-plugin/core.md) 1.2.0

## Recent versions

- 1.2.1 (latest) — 2023-06-16
- 1.2.0 — 2023-05-08
- 1.1.1 — 2023-05-03
- 1.1.0 — 2023-05-02
- 1.0.5 — 2023-04-27
- 1.0.4 — 2023-04-27
- 1.0.3 — 2023-04-24
- 1.0.2 — 2023-04-23
- 1.0.1 — 2023-04-22
- 1.0.0 — 2023-04-20

## README

# @macro-plugin/shared

Shared utils for internel and plugin usage.

## Installation

```sh
# if you use npm
npm i -D @macro-plugin/shared
# if you use pnpm
pnpm i -D @macro-plugin/shared
# if you use yarn
yarn add -D @macro-plugin/shared
```

## API

### `addHook`

add a require hook

### `picomatch`

picomatch file matcher

### `autoRequire`

require or import a package

### `loadConfigFile`

async loading `macros.config.js` or `macros.config.ts`.

### `loadConfigFileSync`

sync loading `macros.config.js` or `macros.config.ts`.

### `writeDts`

write dts to path, check if content is same first.

### `extractSwcOptions`

extract swc options from all your defined options.

### `buildTransformOptions`

load config file, then return `[swcOptions, macroOptions, configPath]`

### `extractInput`

split `(file | pattern)[]` to `{ files, patterns }`

### `extractFiles`

extract files from `(file | pattern)[]`

---
_Source: https://npm.io/package/@macro-plugin/shared · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
