open-index/open-npm huggingface dataset:
npm package: @glitchybyte/dash
Description: Library for general common utilities in most of my projects.
Author: GlitchyByte
Latest version: 1.3.0

# Dash

[![version](https://img.shields.io/badge/version-1.3.0-dodgerblue)](https://github.com/GlitchyByte/dash/releases/tag/v1.3.0)

Library for general common utilities in most of my projects.

Documentation is at [glitchybyte.github.io/dash/](https://glitchybyte.github.io/dash/)

Overall, there are a byte buffer writer and reader classes, a bit
buffer writer and reader classes, some quick math and rng functions,
time duration conversion functions, and other miscellaneous functions.
npm package: @glitchybyte/dlog
Description: Console logging for enhancing logs with source filenames and line numbers while removing all logs in production.
Author: GlitchyByte
Latest version: 2.1.1

# dlog

![version](https://img.shields.io/badge/version-2.1.1-dodgerblue)

## Dev console logger library (with Babel plugin, Vite compatible)

Console logging library and Babel/Vite plugin that enhances logs by 
automatically injecting source filenames (relative to project root) 
and line numbers into log statements. Removes all logging in 
production environments.

#### Goals
* Print original (not transpiled) source filename and line number.
* Usable in React and React Native development.
* Completely remove logging in production.

## API

```ts
dlog.log("message")   // Prints to console.log
dlog.error("message") // Prints to console.error
```

## How to use

### Add package to your project

```bash
npm install --save-dev @glitchybyte/dlog
```

### In Babel (e.g., Expo and React Native development)

Add plugin to `babel.config.js`

```js
{
  presets: [...],
  plugins: [
    ...,
    "@glitchybyte/dlog/babel"
  ]
}
```

### In Vite (e.g., React development)

Add plugin to `vite.config.ts`

```ts
import dlog from "@glitchybyte/dlog/babel"

export default defineConfig({
  plugins: [
    react({
      babel: {
        plugins: [dlog]
      }
    })
  ]
})
```

### Use it in your code

```ts
// path/to/my-code.ts
import { dlog } from "@glitchybyte/dlog"

dlog.log("Some message!")
// @path/to/my-code.ts:4 Some message!
```
npm package: @glitchybyte/zappy
Description: Library for compressing and encoding JSON payloads into Base64Url for efficient transport.
Author: GlitchyByte
Latest version: 3.0.0

# Zappy

[![version](https://img.shields.io/badge/version-3.0.0-dodgerblue)](https://github.com/GlitchyByte/zappy/releases/tag/v3.0.0)
[![spec](https://img.shields.io/badge/spec-2.0.0-palegreen)](https://github.com/GlitchyByte/zappy/blob/v3.0.0/SPEC.md)

Library for compressing and encoding JSON payloads into Base64Url
for efficient transport.

[Read the spec here!](https://github.com/GlitchyByte/zappy/blob/v3.0.0/SPEC.md)

#### Goals

* Capable of encoding any valid utf-8 json string.
* Transportable as URL-safe plain text.
* Produce smaller encoded string than vanilla base64.
* Fast encoding and decoding.

#### Non-Goals

* Encryption. This ain't it. It's obfuscation at best.
* Compressing generic text. Though it may work, Zappy is designed for json.

#### Notes

For non-trivial json payloads, testing has shown the resulting Zappy
string is **smaller than the original** json string! This wasn't a goal,
but it is a satisfying result and worth mentioning.

Zappy strings should not be stored. They are designed for transport
where one side encodes before transmitting and the other side decodes
after receiving. If the spec changes between encoding and decoding,
the result will not be the original string.

## API

```ts
// Encode and decode a Zappy string.
function encodeStringToZappy(str: string): string
function decodeZappyToString(str: string): string

// Encode and decode a Base64Url string.
function encodeStringToBase64(str: string): string
function decodeBase64ToString(str: string): string

// Encode and decode a DeflateRaw-Base64Url string.
function encodeStringToDeflate(str: string): string
function decodeDeflateToString(str: string): string
```

## How to use

### Add package to your project

```bash
npm install @glitchybyte/zappy
```

### Encode and decode in your code

```ts
import {
  decodeZappyToString,
  encodeStringToBase64,
  zappyDefaultContractions
} from "@glitchybyte/zappy"

const json = '{' +
  '"codeUrl":"https://github.com/glitchybyte/zappy",' +
  '"msg":"When I deal with internationalization I think of defenestration."' +
  '}'
const encoded = encodeStringToZappy(json)
console.log(`[${encoded.length}] ${encoded}`)
// [118] dNCI6JqpJjK8bWS7cjew_azBuwOvlztCH6-mpWznmzhrKb5l10AKQDQoPgAa
//       XBCoA24Kh7e3aIAmcNuIXjFk4AKQDXpLESAE9GAN7BrqORuRrW4nTg52_A

// While Base64Url is:
const base64Encoded = encodeStringToBase64(json)
console.log(`[${base64Encoded.length}] ${base64Encoded}`)
// [164] eyJjb2RlVXJsIjoiaHR0cHM6Ly9naXRodWIuY29tL2dsaXRjaHlieXRlL3ph
//       cHB5IiwibXNnIjoiV2hlbiBJIGRlYWwgd2l0aCBpbnRlcm5hdGlvbmFsaXph
//       dGlvbiBJIHRoaW5rIG9mIGRlZmVuZXN0cmF0aW9uLiJ9

const decoded = decodeZappyToString(encoded)
console.log(`[${decoded.length}] ${decoded}`)
// [123] {"codeUrl":"https://github.com/glitchybyte/zappy","msg":"Whe
//       n I deal with internationalization I think of defenestration
//       ."}
```