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

rocker_ipsum

v0.0.8

Published

Generate rocking text instead of lorem ipsum.

Downloads

15

Readme

Rocker Ipsum

A small library that generate rocking text rather than boring lorem ipsum.

Installation

npm install rocker_ipsum

or

yarn install rocker_ipsum

API

RockerIpsum is a function that generates rockin' text for mockups, wireframes, or dummy text wherever you need it.

ES6 +

import { rockerIpsum } from 'rocker_ipsum';

const ipsumText = rockerIpsum(2, 5, 50, 70, true, 6);

ES5 +

var rockerIpsum = require('rocker_ipsum').rockerIpsum;

var ipsumText = rockerIpsum(2, 5, 50, 70, true, 6);

The function will return an array containing one or more objects with rocker ipsum text. See configuration options below.

Options

The main function, rockerIpsum() accepts six parameters, as detailed here:

rockerIpsum(paragraphs, sentences, minWords, maxWords, createTitle, titleMaxLength)

paragraphs integer

The paragraphs parameter allows you to specify how many paragraphs you would like to generate. By default, a single paragraph will be generated.

sentences integer

The paragraphs parameter allows you to specify how many lines of text each paragraph should contain. By default, each paragraph contains five sentences.

minWords integer

The minWords parameter allows you to specify a minimum number of words that each paragraph should contain. By default, each paragraph must contain at least 50 words.

maxWords integer

The maxWords parameter allows you to specify a maximum number of words that each paragraph should contain. By default, there is no maximum number of words per paragraph.

createTitle boolean

The createTitle parameter allows you to create titles in addition to paragraphs. If you pass true as the argument for this parameter, the output will include both title and text. The createTitle parameter is set to false by default.

maxTitleLength integer

The maxTitleLength parameter allows you to specify a maximum number of words that each title should contain. Titles are typically between 5 and 10 words. By default, no maxTitleLength is set. The createTitle variable must be set to true to specify maxTitleLength. Titles can be no longer than 10 words. If you specify a value larger than 10, only 10 words will be returned.

Usage

Generate Rocker Ipsum object by calling the following function:

const generatedText = rockerIpsum(2, 4, 50, 80, true, false);

The resulting generatedText variable should contain an array with two distinct objects, each containing at text field with least four lines of text with a total length between 50 and 80 characters and a title field.

Using Default Values

You do not need to provide arguments if you would like to use only default values (as described above). However, if you would like to customize the function's output, specify arguments that you would like to use and pass null arguments for any of the parameters that you don't care to specify, such as:

const generatedText = rockerIpsum(null, 4, null, 80, true, 5);

Make sure to pass null arguments to any of the parameters that you don't wish to specify.

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.