# @sheeptester/htmlifier

> Packages a Scratch project in an HTML file with no optimisations.

Latest version **1.0.3** (published 2021-10-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install @sheeptester/htmlifier
pnpm add @sheeptester/htmlifier
yarn add @sheeptester/htmlifier
bun add @sheeptester/htmlifier
```

## 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.3 |
| Published | 2021-10-21 |
| First published | 2021-08-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 7 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | SheepTester |
| Maintainers | sheeptester |
| Keywords | htmlifier, scratch, sb3 |

## Links

- npm: https://www.npmjs.com/package/@sheeptester/htmlifier
- npm.io page: https://npm.io/package/@sheeptester/htmlifier

## Dependencies (2)

- [fetch-blob](https://npm.io/package/fetch-blob.md) ^3.1.2
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1

## Alternatives

- [@tsparticles/shape-image](https://npm.io/package/@tsparticles/shape-image.md) — 303.7K weekly downloads
- [@tsparticles/shape-line](https://npm.io/package/@tsparticles/shape-line.md) — 233.7K weekly downloads
- [stringify-attributes](https://npm.io/package/stringify-attributes.md) — 58.6K weekly downloads
- [mobile-drag-drop](https://npm.io/package/mobile-drag-drop.md) — 46.3K weekly downloads
- [@comunica/actor-rdf-parse-html](https://npm.io/package/@comunica/actor-rdf-parse-html.md) — 29.2K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2021-10-21
- 1.0.2 — 2021-08-13
- 1.0.1 — 2021-08-10
- 1.0.0 — 2021-08-09

## README

# [HTMLifier](https://sheeptester.github.io/htmlifier/) for Node

Package a Scratch project inside an HTML file with no optimisations.

## Installation

```sh
$ npm install @sheeptester/htmlifier
```

## Example usage

The following example HTMLifies [Scratch 3.0 is
here!](https://scratch.mit.edu/projects/276660763/) and writes the result to a
file named `index.html`.

```js
import fs from 'fs/promises'
import Htmlifier from '@sheeptester/htmlifier'

async function main () {
  const html = await new Htmlifier()
    .htmlify({ type: 'id', id: '276660763' })
    .then(blob => blob.text())
  await fs.writeFile('./index.html', html)
}

main()
```

Because [`node-fetch`](https://www.npmjs.com/package/node-fetch) is strictly an
ES module, this package is also an ES module. If you're using a CommonJS module,
you can use [`esm`](https://www.npmjs.com/package/esm) to import this package.

```js
require = require('esm')(module)
const Htmlifier = require('@sheeptester/htmlifier')
```

The HTMLifier was primarily written for Deno and the web, so it uses
[`Blob`s](https://developer.mozilla.org/en-US/docs/Web/API/Blob) and
[`File`s](https://developer.mozilla.org/en-US/docs/Web/API/File) to pass binary
data around. You can use
[`fetch-blob`](https://www.npmjs.com/package/fetch-blob) to create `Blob`s and
`File`s for the HTMLifier.

```js
import Htmlifier from '@sheeptester/htmlifier'
import { fileFrom } from 'fetch-blob/from.js'

async function main () {
  const html = await new Htmlifier()
    .htmlify({ type: 'file', file: await fileFrom('./project.sb3') })
    .then(blob => blob.text())
  // ...
}

main()
```

## Documentation

[Auto-generated
documentation](https://doc.deno.land/https/github.com/SheepTester/htmlifier/raw/v1.0.3/src/htmlifier.ts)
is available courtesy of deno doc.

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