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

tfaker

v0.1.0

Published

Lightweight, Targaryen-themed lil' brother of faker.js

Downloads

45

Readme

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 => "[email protected]"
  • 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.