open-index/open-npm huggingface dataset:
npm package: @goodswifter/create-ad
Description: npm template
Author: goodswifter
Latest version: 1.0.4

# @antfu/utils

[![NPM version](https://img.shields.io/npm/v/@antfu/utils?color=a1b858&label=)](https://www.npmjs.com/package/@antfu/utils)
[![Docs](https://img.shields.io/badge/docs-green)](https://www.jsdocs.io/package/@antfu/utils)

Opinionated collection of common JavaScript / TypeScript utils by [@antfu](https://github.com/antfu).

- Tree-shakable ESM
- Fully typed - with TSDocs
- Type utilities - `Arrayable<T>`, `ElementOf<T>`, etc.

> This package is designed to be used as `devDependencies` and bundled into your dist.

## Sponsors

<p align="center">
  <a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
    <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
  </a>
</p>

## License

[MIT](./LICENSE) License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)
npm package: @goodswifter/npm-test
Description: Opinionated collection of common JavaScript / TypeScript utils by @antfu
Author: Anthony Fu
Latest version: 1.0.10

# @antfu/utils

[![NPM version](https://img.shields.io/npm/v/@antfu/utils?color=a1b858&label=)](https://www.npmjs.com/package/@antfu/utils)
[![Docs](https://img.shields.io/badge/docs-green)](https://www.jsdocs.io/package/@antfu/utils)

Opinionated collection of common JavaScript / TypeScript utils by [@antfu](https://github.com/antfu).

- Tree-shakable ESM
- Fully typed - with TSDocs
- Type utilities - `Arrayable<T>`, `ElementOf<T>`, etc.

> This package is designed to be used as `devDependencies` and bundled into your dist.

## Sponsors

<p align="center">
  <a href="https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg">
    <img src='https://cdn.jsdelivr.net/gh/antfu/static/sponsors.svg'/>
  </a>
</p>

## License

[MIT](./LICENSE) License © 2021-PRESENT [Anthony Fu](https://github.com/antfu)
npm package: @goodthnx/metalsmith-handlebars
Description: A complete Handlebars templating plugin for Metalsmith.
Author: Gwilyn Saunders
Latest version: 1.1.0

# Metalsmith Handlebars

Templating in Metalsmith can get messy with lots of different plugins all sort
of trying to work together.

### Things this plugin will do:

- perform layouting with handlebar templates
- and _recursively_ template the contents
- include partials from a folder
- insert helpers from a folder

### Things this plugin will not do:

- anything but Handlebars (maybe later)
- load lots of unnecessary dependencies
- forget to load partials
- fail to load helpers from a parent directory
- ever give you up, or ever let you down


## In essence

This is a plugin that combines 3 or 4 other plugins and tries to do it right.

It's core capability is perform Handlebar templating on a multi-directory
project. Your layout templates can be `.hbs`, your immediate pages can be
`.hbs`, your extra-fancy plugin that loads pages over rsync can be `.hbs`.

At _each of these levels_ you can use the same global context variables
(provided by Metalsmith metadata and Yaml Front Matter), and the same helpers,
and the same partials.

Enjoy!


## Usage

### Set-up your files something like this:

```
layouts/  - for your master .hbs layouts
partials/ - for your .hbs partials
helpers/  - for your .js helpers
public/   - output directory
src/      - input directory
metadata.json - global context
```

### Write your `build.js` like this:
```js
Metalsmith(__dirname)
.source('./src')
.destination('./public')
.metadata(require('./metadata.json'))
.use(handlebars({
    layouts: 'layouts/',
    partials: 'partials/',
    helpers: 'helpers/',
}))

```


### Write a `metadata.json` file like this:
```json
{
    "siteTitle": "Wassup",
    "author": "Me."
}
```

### Write a layout template like this:

```html
<!DOCTYPE html>
<html>
{{> head }}
<body>
  {{{ contents }}}
</body>
</html>
```

### Write a partial template like this:
```html
<head>
    <title>{{ siteTitle }} - {{ page }}</title>
    <meta name="author" content="{{ author }}"/>
</head>
```

### Write a page template like this:

```html
---
layout: main.hbs
page: 'hey.'
---
<div class='container'>
    {{ titleHelper }}
</div>
```

### Write a helper like this:

```js
// helpers/titleHelper.js
module.exports = titleHelper function() {
    return `
        <h1>${this.page}</h1>
        <h2>By ${this.author}</h2>
    `;
}
```


### After that you're left with a regular old plumbus.

```html
<DOCTYPE html>
<html>
<head>
    <title>Wassup - hey.</title>
    <meta name="author" content="Me."/>
</head>
<body>
    <div class='container'>
        <h1>hey.</h1>
        <h2>By Me.</h2>
    </div>
</body>
</html>
```


## Notes

Not demoed here, but a particular use-case is in conjunction with
the _metalsmith-collections_ plugin. This plugin hoovers up files of a
sub-directory of `src/` and these files also may need templating.

This plugin _will_ template these appropriately. Given that they don't have
a `layout` property in their YAML header, they will instead render in-place
without applying a layout template.
npm package: @goodtools/jdserialize
Description: Interpret Java serialized objects
Latest version: 1.0.0

# jdserialize

jdserialize is a JavaScript port of https://github.com/unsynchronized/jdeserialize with an added object normalizer for easier data interpretation.

## Usage

```javascript
import { deserialize, normalize, print } from "@goodtools/jdserialize";

const buf = Buffer.from([
  0xac, 0xed, 0x00, 0x05, 0x73, 0x72, 0x00, 0x1a, 0x74, 0x6f, 0x6f, 0x6c, 0x73,
  0x2e, 0x67, 0x6f, 0x6f, 0x64, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x2e, 0x42,
  0x79, 0x74, 0x65, 0x41, 0x72, 0x72, 0x61, 0x79, 0x42, 0xdd, 0xd3, 0x7e, 0xd6,
  0xd6, 0xb2, 0x45, 0x02, 0x00, 0x01, 0x5b, 0x00, 0x05, 0x76, 0x61, 0x6c, 0x75,
  0x65, 0x74, 0x00, 0x02, 0x5b, 0x42, 0x78, 0x70, 0x75, 0x72, 0x00, 0x02, 0x5b,
  0x42, 0xac, 0xf3, 0x17, 0xf8, 0x06, 0x08, 0x54, 0xe0, 0x02, 0x00, 0x00, 0x78,
  0x70, 0x00, 0x00, 0x00, 0x03, 0x01, 0x02, 0x03,
]);

const deserialized = deserialize(buf);
```

The example serialized object was created using
```java
package tools.good.model;

import java.io.Serializable;

public class ByteArray implements Serializable {
    public byte[] value;
}
```

```java
ByteArray obj = new ByteArray();
obj.value = new byte[]{ 0x01, 0x02, 0x03 };

// serialize obj
```

### Normalization

```javascript
const normalized = normalize(deserialized.objects);
const serialized = JSON.stringify(normalized); // [{"value": [1, 2, 3]}]
```

```json
[
  {
    "value": [
      1,
      2,
      3
    ]
  }
]
```

### Class Dump
```javascript
const classDump = print(deserialized.classes);
console.log(classDump);
```

```java
// handle: 7e0000
class tools.good.model.ByteArray implements java.io.Serializable {
  static final long serialVersionUID = 4818239718080033349L;

  byte[] value;
}
```