open-index/open-npm huggingface dataset:
npm package: @natsubate/secrets-token-generator
Description: A lightweight utility for generating cryptographically secure random tokens in Node.js, similar to Python's secrets module.
Latest version: 1.0.0

# @natsubate/secrets-token-generator [![npm version](https://badge.fury.io/js/@natsubate%2Fsecrets-token-generator.svg)](https://www.npmjs.com/package/@natsubate/secrets-token-generator)

A lightweight utility for generating cryptographically secure random tokens in Node.js, similar to Python's secrets module.

## Install

```bash
npm install @natsubate/secrets-token-generator
```

## Usage

```TypeScript
import { tokenBytes, tokenHex, tokenUrlSafe } from "@natsubate/secrets-token-generator";

const tokenByBuffer = tokenBytes(32); // 32bytes secure random bytes

const tokenByHex = tokenHex(32); // 32bytes secure random HEX string
console.log(tokenByHex); // -> 7b6d3b21cd1a40b3baf2013c475247fa2c577bfef691e4661cce35fc846f328f

const tokenByUrlSafeBase64 = tokenUrlSafe(32); // 32bytes secure random by Base64URL
console.log(tokenByUrlSafeBase64); // -> 7H8lLtZ6A5C96rfpxtbsRiB2lmXj3ctukOM4kywRIwY
```

## API

### tokenBytes(bytes: number): Buffer

Generates a random value of the specified byte count using cryptographically secure pseudo-random number generator (CSPRNG) and returns the buffer.

- **`bytes`**: `number` - Random bytes length (e.g., 32).
- **Returns**: `Buffer` - Raw bytes.

### tokenHex(bytes: number): string

Generates a random value of the specified byte length using CSPRNG and returns the HEX string.

- **`bytes`**: `number` - Random bytes length (e.g., 32).
- **Returns**: `string` - HEX encoded token.

### tokenUrlSafe(bytes: number): string

Generates a random value of the specified byte length using CSPRNG and returns a Base64 URL string.

- **`bytes`**: `number` - Random bytes length (e.g., 32).
- **Returns**: `string` - Base64URL encoded token.

## Supported Environments

* Node.js 18 or later

## TypeScript Type Definition

Included.

## Security Notice

* The implementation uses the Node.js standard module `crypto.randomBytes`.
* While it can be used for security-critical purposes such as CSRF tokens, session IDs, and API keys,
ensure the required entropy amount (byte length) is appropriately set according to your use case.
* Also consider the storage and transmission methods for generated tokens (e.g., using HTTPS, setting the Secure cookie flag).

## Notes

* All functions are synchronous.

## License

* MIT License
npm package: @natsuite/resnet18
Description: Image classifier for our super-important top-secret new product.
Author: NatML
Latest version: 0.0.1

# ResNet 18
Image classifier for our super-important top-secret new product.

## Making Predictions
First, create the predictor:
```typescript
// Fetch the model data from NatML Hub
const modelData = await MLModelData.fromHub("@natsuite/resnet18");
// Deserialize the model
const model = modelData.deserialize();
// Create the predictor
const predictor = new ResNet18HubPredictor(model);
```

Then create an image feature:
```typescript
// Create an iamge feature
const feature = new MLImageFeature("cat.jpg");
```

Finally, classify the image feature:
```typescript
// Classify the image
const [label, score] = await predictor.predict(feature);
// Log result
console.log(`Image contains ${label} with confidence ${score}`);
```
npm package: @natsuneko-laboratory/github-label-presets
Description: GitHub Label presets for all repositories by natsuneko.
Author: Natsune Mochizuki
Latest version: 1.0.1

# @natsuneko-laboratory/github-label-presets

GitHub Label presets for all repositories by natsuneko.

## Setup

```bash
$ npm install --global @azu/github-label-setup

$ github-label-setup --token xxx --labels @natsuneko-laboratory/github-label-presets
```

## License

MIT by [@6jz](https://twitter.com)
npm package: @natsuneko-laboratory/honox-mdx-island
Description: Support for MDX with Island in HonoX.
Author: Natsuneko Laboratory
Latest version: 0.1.1

# @natsuneko-laboratory/honox-mdx-island

Support for MDX with Island in HonoX.

## Installation

```bash
$ npm install @natsuneko-laboratory/honox-mdx-island
```

## Usage

```tsx
// vite.config.ts
import build from "@hono/vite-build/cloudflare-pages";
import adapter from "@hono/vite-dev-server/cloudflare";
import { mdx } from "@natsuneko-laboratory/honox-mdx-island";
import honox from "honox/vite";
import { defineConfig } from "vite";

// remark plugins
import remarkFrontmatter from "remark-frontmatter";
import remarkMdxFrontmatter from "remark-mdx-frontmatter";

export default defineConfig({
  plugins: [
    mdx({
      jsxImportSource: "hono/jsx",
      remarkPlugins: [remarkFrontmatter, remarkMdxFrontmatter],
    }),
    honox({ devServer: { adapter } }),
    build(),
  ],
});
```

## License

MIT
npm package: @natsuneko-laboratory/kiana
Description: Reusable Configurations and Project Toolchain for Node.js projects.
Author: Natsune Mochizuki
Latest version: 1.1.0

# @natsuneko-laboratory/kiana

Reusable Configurations and Project Toolchain for Node.js projects.

## Install

```bash
$ pnpm add @natsuneko-laboratory/kiana --save-dev
```

## Usage

Initialize the Project:

```bash
# default setup
$ pnpm run kiana init

# create GitHub Actions
$ pnpm run kiana init --github-actions

# eject vite config
$ pnpm run kiana init --eject-vite
```

Build the Project:

```bash
$ pnpm run kiana build
```

Test the Project:

```bash
$ pnpm run kiana test
```

Format the Project:

```bash
$ pnpm run kiana format
```

Lint the Project:

```bash
$ pnpm run kiana lint
```

Publish the Project:

```bash
$ pnpm run kiana publish
```

## License

MIT by [@6jz](https://to.natsuneko.com/6jz)
npm package: @natsuneko-laboratory/lycoris
Description: Lycoris is a state management library inspired by Recoil and Jotai, but for Vue 3 and Vue 2 with Composition API
Author: Natsuneko
Latest version: 0.1.1

# @natsuneko/lycoris

Lycoris is a state management library inspired by Recoil and Jotai but for Vue.

### Create a store context

```vue
<template>
  <slot />
</template>

<script lang="ts" setup>
import { useLycorisStore } from "@natsuneko/lycoris";

useLycorisStore();
</script>
```

### Create a primitive atom

```typescript
import { atom } from "@natsuneko/lycoris";

const countAtom = atom({
  key: "count",
  default: 0,
});

const countryAtom = atom({
  key: "country",
  default: "Japan",
});

const citiesAtom = atom({
  key: "cities",
  default: ["Tokyo", "Kyoto", "Osaka"],
});

const mangaAtom = atom({
  key: "manga",
  default: {
    "Lycoris Recoil": 2022,
    "Angel Beats!": 2010,
    "Expelled from Paradise": 2014,
  },
});
```

### Use the atom in your components

```vue
<template>
  <div>
    <h1>{{ count }}</h1>
    <button @click="onClick">one up</button>
  </div>
</template>

<script setup>
import { useLycorisState } from "@natsuneko/lycoris";

const [count, setCount] = useLycorisState(countAtom);

const onClick = () => {
  setCount((c) => c + 1);
};
</script>
```

### Create a selector from derived atom or other selector

```typescript
import { selector } from "@natsuneko/lycoris";

// read-only selector
const readonlyCounter = selector({
  get: ({ get }) => get(countAtom),
});

// writable selector
const writableCounter = selector({
  get: ({ get }) => get(countAtom),
  set: ({ set }, newValue) => set(countAtom, newValue * 2),
});
```

## Known Issues

I forgot it......

## License

Licensed under the MIT License.
npm package: @natsuneko-laboratory/next-theme
Description: Integrate custom theme feature into your Next.js project.
Author: Natsune Mochizuki
Latest version: 0.1.4

# @natsuneko-laboratory/next-theme

Integrate custom theme feature into your Next.js project.

## Installation

```bash
$ npm install @natsuneko-laboratory/next-theme
```

## Usage

Import Provider to your `layout.tsx` or `app.tsx`:

```tsx
import { ThemeProvider } from "@natsuneko-laboratory/next-theme/components/ThemeProvider";

const ApplicationRootLayout = async ({
  children,
}: {
  children: React.ReactNode;
}) => {
  const theme = await getTheme("light"); // throws compile error in this section

  return (
    <ThemeProvider theme={theme}>
      <html className={theme}>
        <body>{children}</body>
      </html>
    </ThemeProvider>
  );
};
```

And create a server action in your any file:

```tsx
// @/app/actions/theme.ts
"use server";

import {
  setTheme as setThemeInternal,
  getTheme as getThemeInternal,
} from "@natsuneko-laboratory/next-theme/actions/theme";
import { cookies } from "next/headers";

export const setTheme = setThemeInternal;

export const getTheme = getThemeInternal;
```

Import the server action in your `layout.tsx` or `app.tsx`:

```tsx
import { getTheme } from "@/app/actions/theme"; // add to head section to avoid compile error
```

Reference current theme in your component:

```tsx
// client
import { useTheme } from "@natsuneko-laboratory/next-theme/components/ThemeProvider";

const theme = useTheme();

// server
import { getTheme } from "@/app/actions/theme";

const theme = await getTheme("light"); // must specify default theme
```

## License

MIT by [@6jz](https://to.natsuneko.com/6jz)
npm package: @natsuneko-laboratory/precinct-ext
Description: The extensions of precinct, this package supports MDX.
Author: Natsune Mochizuki
Latest version: 1.0.0

# @natsuneko-laboratory/precinct-ext

> Unleash the detectives, with more extensions.

Supports:

- MDX

## Usage

```typescript
import precinct from "@natsuneko-laboratory/precinct-ext";
import fs from "node:fs";

const content = fs.readFileSync("README.mdx", "utf-8");
const deps = precinct(content, { type: "mdx" });
```

other usage is the same as the original [precinct](https://github.com/dependents/node-precinct).

## License

MIT
npm package: @natsuneko-laboratory/rust-sass
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# @natsuneko-laboratory/rust-sass

This package is an alternative to the [`sass`](https://www.npmjs.com/package/sass) package but use [`grass`](https://github.com/connorskees/grass) as Sass compiler.

##

## Why use this package?

- `sass` (JS-compiled) is an easy to use but 2.5x and 10x slower than Dart VM.
- `sass` (Dart VM) is a high-performance but dependent on platform outside of Node.js.

## Performance

- `dart` : ~10000ms (10s)
  - Run: `pnpm run test:dart`
- `node` : ~2000ms (2s)
  - Run: `pnpm run test:node`
- `rust` : ~1500ms (1.5s)
  - Run: `pnpm run test:rust`

## Publish

```bash
$ npm version [major|minor|patch]
$ git push --follow-tags
```

## License

MIT by [@6jz](https://twitter.com/6jz)
npm package: @natsuneko-laboratory/rust-sass-linux-arm64-gnu
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# `@natsuneko-laboratory/rust-sass-linux-arm64-gnu`

This is the **aarch64-unknown-linux-gnu** binary for `@natsuneko-laboratory/rust-sass`
npm package: @natsuneko-laboratory/rust-sass-linux-arm64-musl
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# `@natsuneko-laboratory/rust-sass-linux-arm64-musl`

This is the **aarch64-unknown-linux-musl** binary for `@natsuneko-laboratory/rust-sass`
npm package: @natsuneko-laboratory/rust-sass-linux-x64-gnu
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# `@natsuneko-laboratory/rust-sass-linux-x64-gnu`

This is the **x86_64-unknown-linux-gnu** binary for `@natsuneko-laboratory/rust-sass`
npm package: @natsuneko-laboratory/rust-sass-linux-x64-musl
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# `@natsuneko-laboratory/rust-sass-linux-x64-musl`

This is the **x86_64-unknown-linux-musl** binary for `@natsuneko-laboratory/rust-sass`
npm package: @natsuneko-laboratory/rust-sass-win32-arm64-msvc
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# `@natsuneko-laboratory/rust-sass-win32-arm64-msvc`

This is the **aarch64-pc-windows-msvc** binary for `@natsuneko-laboratory/rust-sass`
npm package: @natsuneko-laboratory/rust-sass-win32-x64-msvc
Description: The Sass compiler wrapper with grass, a Rust implementation, as backend.
Latest version: 0.0.1

# `@natsuneko-laboratory/rust-sass-win32-x64-msvc`

This is the **x86_64-pc-windows-msvc** binary for `@natsuneko-laboratory/rust-sass`
npm package: @natsuneko-laboratory/unitypackage
Description: Archive / Extract / Search UnityPackage from Node.js, written in TypeScript. No platform dependency.
Author: Natsune Mochizuki
Latest version: 1.1.1

# @natsuneko-laboratory/unitypackage

Archive / Extract / Search UnityPackage from Node.js, written in TypeScript. No platform dependency.

## Requirements

- Node.js >= 18

## Install

```bash
$ npm add @natsuneko-laboratory/unitypackage
$ yarn add @natsuneko-laboratory/unitypackage
$ pnpm add @natsuneko-laboratory/unitypackage
```

## Usage

```typescript
import { archive, extract } from "@natsuneko-laboratory/unitypackage";

// create a unitypackage
await archive({
  files: [
    // files to archive
    "/path/to/assets/MonoBehaviour.cs",
    "/path/to/assets/Prefab.prefab",
  ],
  root: "/path/to", // unity project root
  dest: "/path/to/archive.unitypackage", // destination path
  transform: (path) => join("Assets", join), // transform path (optional)
});

// extract a unitypackage
await extract({
  file: "/path/to/archive.unitypackage",
  root: "/path/to", // unity project root
  transform: (path) => join("Assets", join), // transform path (optional)
});
```

## Development

```bash
# prepare
$ pnpm install

# publish
$ npm publish --access public
```

## License

MIT by [@6jz](https://twitter.com/6jz)
npm package: @natsuneko-laboratory/vite-plugin-next-directives
Description: Support use client/server directives in Vite
Author: Natsune Mochizuki
Latest version: 0.1.0

# @natsuneko-laboratory/vite-plugin-next-directives

Support use client/server directives in Vite

## Installation

```bash
$ npm install @natsuneko-laboratory/vite-plugin-next-directives
```

## Usage

Add `directives()` to your Vite configuration:

```typescript
// vite.config.ts
import { defineConfig } from "vite";
import { directives } from "@natsuneko-laboratory/vite-plugin-next-directives";

export default defineConfig({
  plugins: [...directives()],
});
```

## License

MIT by [@6jz](https://to.natsuneko.com/6jz)
npm package: @natsuneko-laboratory/vpmpackage
Description: Operate VPMPackage from Node.js. No platform dependency. No additional instructions.
Author: Natsune Mochizuki
Latest version: 0.5.2

# @natsuneko-laboratory/vpmpackage

Create a VPMPackage from Node.js, written in TypeScript. No platform dependency. No additional instructions.

## Requirements

- Node.js >= 24

## Install

```bash
# one of
$ npm install @natsuneko-laboratory/vpmpackage
$ yarn add @natsuneko-laboratory/vpmpackage
$ pnpm add @natsuneko-laboratory/vpmpackage
```

## Usage

```typescript
import { archive } from "@natsuneko-laboratory/vpmpackage";

await archive({
  name: "cat.natsuneko.asset-lens", // package name that archived as ...
  package: "Assets/NatsunekoLaboratory/AssetLens/package.json", // package.json path of VPM package
  dist: "./dist/package.zip", // output filename
});
```

## Development

```bash
# prepare
$ pnpm install

# publish
# → automated by GitHub Actions
```

## License

MIT by [@6jz](https://twitter.com/6jz)