npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@kotofurumiya/th-namegen

v1.1.3

Published

Random name string generater from Touhou Project

Downloads

8

Readme

th-namegen

Random name string generater from Touhou Project.

Output Samples

reimu-kirisame
remilia-izayoi
marisa-cirno

Progress

| Category | Status | |:-------------------|:-------------| | PC98-Games | 🚧 Not yet | | TH6-TH17 | ✅ done | | TH17.5 Gouyokuibun | 🚧 Not yet | | TH18 Kouryuudou | 🚧 Not yet | | Books | ✅ Suichouka | | CDs | ✅ Hifuu |

See docs/covered_titles.md for more detailed status.

Support

| Engine | Version | Status | Note | |:--------|:-----------------|:-------------|:-----:| | Browser | legacy (e.g. IE) | 🚫 never | *1 | | Browser | es2018 | ✅ supported | | | Node.js | older than 13.14 | 🚫 never | | | Node.js | 13.14+ | ✅ supported | | | Node.js | 14.x | ✅ supported | | | Node.js | 15.x | ✅ supported | | | Deno | any | 🚧 not yet | |

*1: Not supported officially on Internet Explorer but it may be runnable via transpilers(tsc, babel).

Usage(Node.js)

Install:

npm install @kotofurumiya/th-namegen

Use it:

// syntax for TypeScript or modern JavaScript
import { generateName } from '@kotofurumiya/th-namegen';

// syntax for traditional JavaScript
// const { generateName } = require('th-namegen');

const name = generateName();
console.log(name); // e.g. `patchouli-scarlet`

Usage(Browser)

Copy build/th-namegen-web.js to your project.

<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>Your Web Page</title>

    <!-- insert script file -->
    <script src="th-namegen-web.js"></script>

    <!-- then, write your code -->
    <script>
      const name = thNameGen.generateName();
    </script>
  </head>
  <body>
    Your Contents
  </body>
</html>

API

generateName(options)

Generates random name. You can specify some options.

// simple use
// generates like `reimu-kirisame`
const name1 = generateName();

// with options
// generates like `reimu:kirisame`
const name2 = generateName({
  delimiter: ':'
});

// with options
// generates like `Reimu Kirisame`
const name2 = generateName({
  delimiter: ' ',
  nameChunkConverter: (name) => name[0].toUpperCase() + name.slice(1)
});

You can use filters to limit character source.

import { generateName, selectCharacters, oneOfTitleTags } from '@kotofurumiya/th-namegen';

// choose your favorite!
const myFavorites = selectCharacters([oneOfTitleTags(['pc-98'])]);

// then generate name with only PC-98 characters!
const name = generateName({
  characterCandidates: myFavorites
});

For more information, see docs/filters.md.

All options:

type TouhouNameGenOptions = {
  // name delimiter. default is '-' (hyphen)
  delimiter?: string;

  // coverter for each name chunk.
  nameChunkConverter?: (name: string, context?: NameProcessContext) => string;

  // you can specify character's data 
  characterCandidates?: ReadonlyArray<TouhouCharacter>;

  // for internal debug. You don't need use this.
  randomFunc?: (min: number, max: number) => number;
};

// 2nd arg of nameChunkConverter
type NameProcessContext = {
  character: TouhouCharacter;
  treatedAs: 'firstName' | 'lastName';
};

// character data
type TouhouCharacter =
  | {
      nameType: 'simple';
      name: string;
    }
  | {
      nameType: 'fullname';
      firstName: string;
      middleName?: string;
      lastName: string;
      aka?: string; //  e.g.'udonge' for Udongein
    };

Contribution

Requires Node.js v14+ for development

  1. clone this repoitory
  2. change codes
  3. run npm run format
  4. run npm run lint
  5. run npm run test
  6. git add changes(must includes build/ directory)
  7. commit with Conventional Commit
    1. example1: git commit -m "fix: make Koishi discoverable"
    2. example2: git commit -m "feat: add beer for ZUN"
    3. example3: git commit -m "refactor: sell unused magick items to Kourindou"
  8. create Pull Request