# preact-script2

> Library for insert tag for Preact, inspired by vue-script2

Latest version **1.0.0** (published 2019-02-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install preact-script2
pnpm add preact-script2
yarn add preact-script2
bun add preact-script2
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2019-02-28 |
| First published | 2019-02-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Irfan Maulana |
| Maintainers | irfan.maulana |
| Keywords | preact, script, load-script, preact-component |

## Links

- npm: https://www.npmjs.com/package/preact-script2
- Repository: https://github.com/mazipan/preact-script2
- Homepage: https://github.com/mazipan/preact-script2#readme
- Issues: https://github.com/mazipan/preact-script2/issues
- npm.io page: https://npm.io/package/preact-script2

## Dependencies (2)

- [preact](https://npm.io/package/preact.md) ^8.2.1
- [preact-compat](https://npm.io/package/preact-compat.md) ^3.17.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2019-02-28

## README

# preact-script2

Library for insert &lt;script> tag for Preact, inspired by vue-script2

[![version](https://img.shields.io/npm/v/preact-script2.svg)](https://www.npmjs.com/package/preact-script2) ![minified](https://badgen.net/bundlephobia/minzip/preact-script2) [![downloads](https://img.shields.io/npm/dt/preact-script2.svg)](https://www.npmjs.com/package/preact-script2) [![Travis](https://img.shields.io/travis/mazipan/preact-script2.svg)](https://travis-ci.org/mazipan/preact-script2)

## Download

```bash
# NPM
npm install preact-script2

# Yarn
yarn add preact-script2
```

## Usage

```js
import Script2 from 'preact-script2';

export default class App extends Component {
  render() {
    return (
      <div>
        <Script2 src="/test.js" async type="some-type" integrity="1234567890" text="QWERTYUIOP" crossorigin="anonymous" />
        <Script2
          inlineScript="(function a() {console.warn('Hey, you just loading an inline script')})()" />
      </div>
    );
  }
}
```

## Available Props

| Props Name           |              Type             |             Note             |
| :------------------: | :---------------------------: | :--------------------------: |
| `src`                | String                        | -                            |
| `async`              | String                        | -                            |
| `type`               | String                        | -                            |
| `integrity`          | String                        | -                            |
| `text`               | String                        | -                            |
| `crossorigin`        | String                        | -                            |
| `inlineScript`       | String                        | -                            |

## Development

```bash
# NPM

# Running development
npm run dev
# Build demo apps
npm run build
# Build library for publish
npm run bundle

# Yarn

# Running development
yarn dev
# Build demo apps
yarn build
# Build library for publish
yarn bundle
```

## Credit

-   [Preact](https://preactjs.com/)
-   [Vue-Script2](https://github.com/taoeffect/vue-script2)
-   [Microbundle](https://github.com/developit/microbundle)

* * *

Copyright © 2019 by Irfan Maulana

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