shakespeare-data
A little JavaScript library you can import and use in your projects as an alternative to Lorem Ipsum style test data.
Installation
npm i --save shakespeare-data
API
All of Shakespeare's sonnets are included, with a simple API to retrieve them:
sonnets.all()
Retrieves all the sonnets in an array in the following structure:
sonnets.find(term)
Retrieves all the sonnets matching the term in an array in the same structure as all():
sonnets.random()
Retrieves a single sonnet randomly from the list of all sonnets.
Use it in Node!
If you're on a node server, just require it and off you go.
var shakespeare = ;var sonnetsContainingTruth = shakespearesonnets;
Use it in Angular
Import it in angular by importing it into a component and binding it with an HTML template.
Example: https://luketn.github.io/shakespeare-data/
Code: https://github.com/luketn/shakespeare-data/blob/master/example-angular/src/app/app.component.ts
Component:
;; @ shakespeare = ; sonnets = thisshakespearesonnetsall; { thissonnets = thisshakespearesonnets; }
Template:
{{sonnet.number}} {{line}}
Contributions
If you'd like to contribute to the project, note that we use semantic versioning and commitizen conventions.
These differentiate breaking and non-breaking changes clear, and update version numbers for changes accordingly.
Commitizen: http://commitizen.github.io/cz-cli/
Semantic Release: https://semantic-release.gitbooks.io/semantic-release
Use the package script 'commit' to perform commits, which will invoke commitizen correctly:
git add .
npm run commit