Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nerdata

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nerdata

testdata for the fantasy/scifi enthusiast

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

nerdata

Testdata from scifi and fantasy, because y'all need it.

DATA

Supported universes:

  • Lord of the Rings
  • Star Wars
  • Rick and Morty
  • Dune

Planned universes:

  • Doctor Who
  • Harry Potter

INITIALIZATION

const { Nerdata } = require("nerdata");

A new instance can be specified with all universes:

const nerdata = new Nerdata();

To limit memory usage, you can limit in two ways:

// Inclusive
const nerdata = new Nerdata({
  include: ["dune", "star-wars"],
});
// Exclusive
const nerdata = new Nerdata({
  exclude: ["rick-and-morty"],
});

USAGE

Call signature: nerdata.namespace.method([universes], [options])

Each method will return a random item from all loaded universes if no arguments are given. Universes can be filtered by providing a string or array of strings. Requesting a universe that does not exist or has not been loaded will throw an error.

Options may be provided for certain methods as an object.

nerdata.name.full(); // full name from any loaded universe
nerdata.name.full("star-wars"); // full name from Star Wars
nerdata.name.full(["dune", "star-wars"]); // full name from Dune or Star Wars
nerdata.name.full("fifty-shades-of-grey"); // ERROR: unsupported or unloaded

API

All return values are strings.

methoddescriptionexamples
name.firstfirst name"Han", "Aragorn", "Paul"
name.lastlast name"Solo", "Sanchez", "Atreides"
name.fullfull name"Han Solo", "Rick Sanchez", "Frodo Baggins"
place.anyname of location (any type)"Ahto City", "Gazorpazorp", "Caladan"
place.cityname of city"Ahto City", "Seattle", "Bandalong"
place.realmname of realm"Tattooine", "Gazorpazorp", "Gondor"
item.anyname of item (any type)"light saber", "space cruiser", "suspensor"
item.toolname of tool"neural band", "plumbus", "suspensor"
item.weaponname of weapon"Narsil", "freeze ray", "crysknife"
item.vehiclename of vehicle"X-Wing", "space cruiser", "ornithopter"
species.anyname of species (any type)"jawa", "splorpian", "sandworm"
species.sentientname of sentient species"jawa", "human", "tleilaxu"
species.nonsentientname of nonsentient species"bantha", "fleeb", "sandworm"
quote.sentencefull sentence with punctuation"There is no try: only do."
quote.paragraphmultiple sentences with punctuation"There is no try: only do. You pass butter. "

OPTIONS

quote.sentence: opts.citation
  • citation: if true, appends speaker to quote
    • true: "It's a trap!" - Admiral Ackbar
    • false: It's a trap!
nerdata.quote.sentence("rick-and-morty", { citation: true }); // '"I made the bomb, Morty." - Rick Sanchez'
nerdata.quote.sentence("rick-and-morty", { citation: false }); // 'I made the bomb, Morty.'
nerdata.quote.sentence("rick-and-morty"); // 'I made the bomb, Morty.'
quote.paragraph: opts.sentences
  • sentences: number of sentences in paragraph
    • default: 3
nerdata.quote.paragraph("rick-and-morty", { sentences: 1 }); // 'I made the bomb, Morty.'
nerdata.quote.paragraph("rick-and-morty"); // 'I made the bomb, Morty. You pass butter. I mean, why would a Pop-Tart want to live inside a toaster, Rick?'

BUILDING

To build, run npm run compile. This first compiles the Typescript code and then auto-generates Flow definitions. Some magic is done here to add // @flow, and the generator can make mistakes, so be sure to run npm run check-flow to be sure everything worked.

CONTRIBUTING

I don't have a system in place yet for managing pull requests -- shoot me a message at daniel.rigberg@gmail.com, and let's talk!

FAQs

Package last updated on 05 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc