tfaker

0.1.0 • Public • Published

tfaker.js

Faking Targaryen data has never been easier

https://nodei.co/npm/tfaker.png?downloads=true&downloadRank=true&stars=true
Daenerys Targaryen
Build Status Known Vulnerabilities GitHub code size in bytes Codacy Badgegih

Compatibility

Node
Zero dependencies policy is to ensure tfaker long-term compatibility with 0.10.48.

Import

var tfaker = require("tfaker");   // everywhere with npm (tfaker is in node_modules)   
var tfaker = require("./tfaker");   // locally with git clone (absolute path to tfaker/index.js)

Methods

Targaryens

  • tfaker.firstName() // random output => "Aegon"
  • tfaker.lastName() // output => "Targaryen"
  • tfaker.fullName() // random output => "Visenya Targaryen"
  • tfaker.dragon() // random output => "Meraxes"
  • tfaker.email() // random output => "dragonchan35@dragonstone.wst"
  • tfaker.country() // random output => "Westeros"
  • tfaker.region() // random output => "The Red Waste"
  • tfaker.city() // random output => "Braavos"

Kittens

  • tfaker.placeKitten() // display 100px kitten image. output => "http://placekitten.com/100/100"
    NB: this method can also use one or two Integer arguments, translating into width & height in pixels:
tfaker.placeKitten(420); // one parameter for squares => "http://placekitten.com/420/420"
tfaker.placeKitten(800, 600); // two for width & height => "http://placekitten.com/800/600"

Utils

  • tfaker.realDate() // random Date(last century) => "Wed Jul 31 1985 00:10:18 GMT+0100(CEST)"
  • tfaker.islamicDate() // islamic new Date(); output => "Jumuah, 28 Muharram 1441 AH"
    NB: this method accepts either an adjustment Integer parameter, or a "zif" / "fake" string parameter:
tfaker.islamicDate(1); // returns islamicDate(1) +1 day => "Jumuah, 29 Muharram 1441 AH".
tfaker.islamicDate("zif"); // returns random past date within 8O years => "Sabt, 4 Jumadal Ula 1384 AH"
tfaker.islamicDate("fake"); // works the same

Stumbled upon this function while searching for lunar calendars for Westeros. Since faker.js doesn't have this feature, I've thought it would be cool to have. Afterall the Valyrian Freehold was very tolerant of other religions.


EZ Tweaks

Each file in ./content is named after the method calling it, and is basically an array of content. You can customize any of those methods by dropping your stuff into the array.


F.A.Q

Have you heard about Babeljs

Babeljs is an awesome, one of a kind library * thumbs up * Jon Snow

Issues (jk! if anything PLEASE DO)

DanyNope

Pull Requests

DanyYay

What's next

./TODO.md

Credits

  • faker.js obviously the main inspiration source. Excellent library that I intend to continue to use in harmony with mine.
  • Dany for the "bEsT sEaSoN eVEr" and also best eyebrows.
  • placekitten.com for the awesome free service. Click 'em
  • jeffreylancaster This goldmine helped me to parse stuff like cities & regions. Thank you !
  • al-habib.info Liked your function for being both concise and digestible.

Readme

Keywords

Package Sidebar

Install

npm i tfaker

Weekly Downloads

12

Version

0.1.0

License

SEE LICENSE IN TARGARYEN_UNLICENSE

Unpacked Size

23.7 kB

Total Files

40

Last publish

Collaborators

  • therealbarenziah