open-index/open-npm huggingface dataset:
npm package: @small-tech/hyperscript-to-html-string
Description: Fork of vhtml that doesn’t sanitise its content. Optimised for use in Kitten.
Author: Jason Miller
Latest version: 1.0.0

# @small-tech/hyperscript-to-html-string

## Renders hyperscript to HTML string

This is a fork of [vhtml by Jason Miller](https://github.com/developit/vhtml) but, unlike vhtml, it does not carry out any sanitisation. Sanitisation should be carried out at a higher level – for example in your server-side framework. You should most likely be using Jason’s module unless you understand the differences and know why you might prefer this one.

This module exists mainly for use by [Kitten](https://codeberg.org/kitten/app)).

## What’s different

The differences are mostly due to Kitten’s use case of targetting HTML authoring on the server.

  - Does __not__ carry out sanitisation. Simply renders `hyperscript` (from e.g., htm or xhtm) into an HTML string. You must carry out sanisation of untrusted content before it reaches this module (e.g., in your authoring framework).

  - Boolean HTML attributes are output as just the name of the attribute, not `attribute="true"` (e.g.,`h('main', {hidden: true})` is rendered as `<div hidden></div>`, not `<div hidden="true"></div>`)
  - It does not include support for `dangerouslySetInnerHTML` (as everything is dangerously set because it does not carry out validation).
  
  - You can include `<style>` and `<script>` tags in your markup.

  - HTML entities are supported.

Other differences:

  - Moved repository to Codeberg.
  - Changed npm package name to @small-tech/hyperscript-to-html-string
  - Reset version to 1.0.0 for new fork.
  - Made the module ESM-only to keep things simple.
  - Source is now in the main directory, in a single file.
  - Tests are now in [tape](https://github.com/ljharb/tape) with [tap-monkey](https://github.com/small-tech/tap-monkey) reporter instead of mocha and chai.
  - Tests now use [xhtm](https://github.com/dy/xhtm) instead of JSX.
  - Tests are now in the main directory, in a single file.
  - Removed 18 development dependencies including babel, rollup, and uglify.

For full list of changes, please [see the changelog](https://codeberg.org/small-tech/vhtml/src/branch/master/CHANGELOG.md).

## Installation

Via npm:

`npm install @small-tech/vhtml`

## Usage

See [vhtml](https://github.com/developit/vhtml) but keep in mind that this module does not sanitise its content.

## License

MIT (as per the original module)
npm package: @small-tech/import-fresh
Description: Import a fresh, uncached, version of an EcmaScript Module (ESM; aka ES6 module/JavaScript Module).
Author: Aral Balkan
Latest version: 1.0.1

# @small-tech/import-fresh

Import a fresh, uncached version of an EcmaScript Module (ESM; aka ES6 module/JavaScript Module).

---

___Note:__ This will leak memory and eventually crash your system. [Garbage collecting stale ESM modules is not a solved problem](https://github.com/nodejs/modules/issues/307) as of Feb, 2021. Do not use this in production._

---

## Syntax

```js
importFresh(absolutePathToModule)
```

## Example

In _module.mjs_:

```js
export default (() => Math.random())
```

In _index.mjs_:

```js
import path from 'path'
import importFresh from '@small-tech/importFresh'

console.log((await importFresh(path.resolve('./module.mjs'))).default)
console.log((await importFresh(path.resolve('./module.mjs'))).default)
```

Run _index.mjs_ and note that you see two different random numbers.

## Do you need this module?

Before you just `npm install` this, ask yourself if you really need it.

If you’re only going to use this in one place, you can cache bust using a single line of vanilla JavaScript:

e.g.,

```js
const myModule = await import(`./my-module?update=${new Date()}`)
```

(Bonus: you won’t have to use absolute paths.)

And if you want to use it from several places in the same file, you can just make a simple function:

```js
function importFresh(modulePath) {
  return await import(`${modulePath}?update=${new Date()}`)
}
```

The only time this module really saves you any work is if you need this functionality from multiple files within your project.

So evaluate whether you need to use it and save a dependency if you don’t.

## Like this? Fund us!

[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share [our vision](https://small-tech.org/about/#small-technology) and want to support our work, please [become a patron or donate to us](https://small-tech.org/fund-us) today and help us continue to exist.

## Copyright

&copy; 2021 [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org).

## License

[MIT](https://opensource.org/licenses/MIT)
npm package: @small-tech/required
Description: Add required argument checking to your functions.
Author: Aral Balkan
Latest version: 1.0.3

# @small-tech/required

Fail-fast on missing required arguments in JavaScript using default values that throw.

[Read the blog post.](https://ar.al/2020/03/23/fail-fast-on-missing-required-arguments-in-javascript-using-default-values-that-throw/)

## Install

```sh
npm i @small-tech/required
```

## Use

```js
const required = require('@small-tech/required')

function foo (puppy = required('puppy')) {
  // It’s safe to use puppy from here on.
}

// Output: Error: Missing argument (puppy).
foo()
```

## Features

  - Throws errors on missing required arguments.
  - 100% code coverage ;P
  - Yes, you could just write this yourself.

## Like this? Fund us!

[Small Technology Foundation](https://small-tech.org) is a tiny, independent not-for-profit.

We exist in part thanks to patronage by people like you. If you share [our vision](https://small-tech.org/about/#small-technology) and want to support our work, please [become a patron or donate to us](https://small-tech.org/fund-us) today and help us continue to exist.

## Copyright

&copy; 2020 [Aral Balkan](https://ar.al), [Small Technology Foundation](https://small-tech.org).

## License

[MIT](https://opensource.org/licenses/MIT)
npm package: @small-tech/sendevent
Description: Fork of sendevent: Middleware for server-sent-events with iframe fallback
Author: Felix Gnass
Latest version: 1.0.2

# sendevent

---

## Note: this is a fork.

I’m publishing this fork for our own internal use at [Small Technology Foundation](https://small-tech.org) in [Site.js](https://sitejs.org) and you are, of course, more than welcome to use it in your projects but you should probably use [Felix Gnass’s original repository](https://github.com/fgnass/sendevent).

Thank you, Felix, for this and for [instant](https://github.com/fgnass/sendevent) (which sendevent is used in) for making my life easier and Site.js better :)

__Original readme follows:__

---

Middleware to stream [server-sent events](http://en.wikipedia.org/wiki/Server-sent_events)
to the client. Browsers that don't support the EventSource interface will fall
back to a [hidden iframe](http://en.wikipedia.org/wiki/Comet_%28programming%29#Hidden_iframe).

## Server

Here is a simple [express](http://expressjs.com/) app that broadcasts a
timestamp every 10 seconds.

```js
var express = require('express');
var sendevent = require('sendevent');
var app = express();

// create a middlware that handles requests to `/eventstream`
var events = sendevent('/eventstream');

app.use(events);

// serve an empty page that just loads the browserify bundle
app.get('/', function(req, res) {
  res.end('<script src="/bundle.js"></script>');
});

// broadcast data to all connected clients every 10 seconds
setInterval(function() {
  events.broadcast({ time: Date.now() });
}, 10000);
```

### Advanced Usage

```js
// if needed you can also talk to individual clients
events.on('connect', function(client) {
  client.send({ greeting: 'hello number ' + client.id });
});

// and get notified when they disconnect
events.on('disconnect', function(client) {
  console.log('client %d disconnected', client.id);
});
```

## Client

If you use browserify you can simply require `sendevent` module:

```js
var on = require('sendevent');
on('/eventstream', function(ev) {
  console.log(ev);
});
```

### The MIT License (MIT)

Copyright (c) 2013 Felix Gnass

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
npm package: @small-tech/vhtml
Description: Fork of vhtml optimised for use in Kitten.
Author: Jason Miller
Latest version: 1.0.0

# vhtml

## Fork of vhtml optimised for Kitten

Fork of [vhtml by Jason Miller](https://github.com/developit/vhtml) optimised for use by [Kitten](https://codeberg.org/kitten/app).

If you’re wondering which module to use, you probably should use Jason’s original one.

## What’s different

The differences are mostly due to Kitten’s tagged templates targetting HTML rather than JSX.

  - Boolean HTML attributes are output as just the name of the attribute, not `attribute="true"` (e.g.,`h('main', {hidden: true})` is rendered as `<div hidden></div>`, not `<div hidden="true"></div>`)

  - `<style>…</style>` tags are not escaped, so you can use quotation marks in them.

Other differences:

  - Moved repository to Codeberg.
  - Removed some optimisations (minification, etc.) that don’t make sense for Kitten’s use case.
  - Migrated tests to tape.
  - Made the module ESM-only to keep things simple.
  - New npm package name.

## Installation

Via npm:

`npm install @small-tech/vhtml`

## Usage

See [vhtml](https://github.com/developit/vhtml)

## License

MIT (as per the original module)