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

slova

v2.2.9

Published

A placeholder tool for generating non-existing words

Downloads

12

Readme

Overview

Slova (Russian word for "words", pronounced /slova/) is a placeholder tool generating non-existing words. It includes various generators such as: word, text & mumbleRap.

Install

$ npm install slova
$ yarn add slova

Usage

You can generate a random word, text, rap, etc. with just a few lines of code.

For a word creation you have to define a word function wrapper or Word/WordGenerator class with several options, all of them are optional:

import { word, Word } from "slova"; // esm
const { word, Word } = require("slova"); // or cjs

const nickname = word({
  length: 5, // Generates a word with 5 letters
  amount: 10, // Generates 10 words with a length of 5 letters
  syllables: 3 // Generates 10 words with a length of 5 letters and 3 syllables
});

const username = new Word({
  length: 5, // Generates a word with 5 letters
  amount: 10, // Generates 10 words with a length of 5 letters
  syllables: 3 // Generates 10 words with a length of 5 letters and 3 syllables
});

console.log(nickname());
console.log(username.generate());
// Generates a word with given options
// Always returns an array of words

For a text creation you have to define function/class as well, this time it is a text or Text/TextGenerator:

import { text, Text } from "slova"; // esm
const { text, Text } = require("slova"); // or cjs

const article = text({
  length: 100, // Generates a paragraph with 100 letters (spaces count as well)
  words: 10, // Generates a paragraph with length of 100 letters & 10 words, if not specified, words amount will be randomized
  paragraphs: 3 // Generates 3 paragraphs with given options above
});

const blog = new Text({
  length: 100, // Generates a paragraph with 100 letters (spaces count as well)
  words: 10, // Generates a paragraph with length of 100 letters & 10 words, if not specified, words amount will be randomized
  paragraphs: 3 // Generates 3 paragraphs with given options above
});

console.log(article());
console.log(blog.generate());
// Generates a text with given options
// Always returns an array of paragraphs

Unlike previous functions/classes for a mumble rap generation you'd have to pass a required scheme option:

import { mumbleRap, MumbleRap } from "slova"; // esm
const { mumbleRap, MumbleRap } = require("slova"); // or cjs

const randomshit = mumbleRap({
  scheme: 'q-c-q-q-c', // Scheme of the mumble rap separated with "-" (quatrains are "q", choruses are "c")
  length: 150 // Generates a quatrain & chorus with 150 letters (spaces count as well)
});

const manImBadAtNamingVars = new MumbleRap({
  scheme: 'q-c-q-q-c', // Scheme of the mumble rap separated with "-" (quatrains are "q", choruses are "c")
  length: 150 // Generates a quatrain & chorus with 150 letters (spaces count as well)
});

console.log(randomshit());
console.log(manImBadAtNamingVars.generate());

Documentation

All the available documentation regarding the usage of the package is in jsdoc of each / types.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

This project is under MIT license. You can freely use it for your own purposes.