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

poem-gen

v0.3.0

Published

Poem generator

Downloads

57

Readme

poem-gen

poem-gen is a poem generator created for NaNoGenMo 2014 by Camden Segal. It uses large source texts from Project Gutenberg to make poems.

How It Works

The source texts are converted into word maps - each word is linked with all words that are used before it - so the generator can imitate the usage of the word from the source text.

Then a random word with existent rhymes in the source text is chosen as the first word of the poem. Each line is built from last word to first word using the word map. Words are added till the number of desired syllables is met.

This process is repeated for each line within the confines of the chosen rhyming scheme. Rhyme scheme, source text, and length are customizable.

Installation

To install the command line client:

npm install -g poem-gen

poem-gen can also be used as a module in other node projects if you install it locally:

npm install poem-gen

Use

CLI Options

Options:

-h, --help             output usage information
-V, --version          output the version number
-d, --data [file]      Use built in data file [all]
-f, --file [file]      Use specific source file
-r, --repeats [count]  Times to repeat rhyming scheme
-w, --words [count]    Poem word length (overrides repeats)
-v, --verbose          Show extra info
-s, --scheme [scheme]  Scheme name or pattern

Data sets

Used with the -d option. Like $ poem -d spooky/moby-dick

  • all - All texts combined together.
  • epic
    • epic/gullivers-travels
    • epic/oliver-twist
    • epic/tale-of-two-cities
  • romance
    • romance/jane-austen
    • romance/kamasutra
  • spooky
    • spooky/dracula
    • spooky/frankenstein
    • spooky/moby-dick
    • spooky/poe
    • spooky/sleepy-hallow
  • weird
    • weird/pizza
    • weird/ulysses

Rhyming Schemes

Used with the -s option. Like $ poem -s limerick.

You can also specify a custom scheme in the format of "aX" where a is any character for use as a rhyming group specifier and X is the number of syllables.

So $ poem -s "a5 b10 a7" would generate a three line poem:

  • The first line would be five syllables
  • The second line would be ten syllables
  • And the third line would be 7 syllables and would rhyme with the first line.

Built in schemes:

  • sonnet - a10 b10 a10 b10 c10 d10 c10 d10 e10 f10 e10 f10 g10 g10
  • haiku - a5 b7 c5
  • couplet - a8 a8
  • triplet - a8 a8 a8
  • alternating - a8 b8 a8 b8
  • limerick - a9 a9 b6 b6 a9