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

@g749/plugin-node-faker

v1.0.5

Published

A plugin for Pattern Lab that allows Faker in the data.json file

Downloads

9

Readme

Faker for Pattern Lab-Node

This is a plugin that adds Faker data to your data.json file at build time.

Install

npm install --save @g749/plugin-node-faker

(Remember to run NPM run postinstall in your Pattern Lab base directory.)

Usage

In data.json, add Faker API methods as strings. Call the vars as you normally would inside Mustache (untested with other PL engines).

{
  "company" : {
    "name" : "faker.name.findName",
    "url" : "faker.internet.url"
  }
}

Some common Faker API methods

@faker.[SECTION].[PROPERTY]([OPTIONS])@ // `options` and parenthesis are optional
@faker.name.findName@ // returns 'Neal Considine'
@faker.name.firstName@ // returns 'Jaron'
@faker.name.lastName@ // returns 'Will'
@faker.internet.url@ // returns 'https://heath.org'
@faker.lorem.paragraph@ // returns paragraph
@faker.lorem.words(5)@ // returns 5 words
@faker.lorem.text(500)@ // returns random number of characters less than 500. Could be 20 chars. Could be 200.

Check out Faker on NPM for all the different API methods (https://www.npmjs.com/package/faker). I've found Marak's Github wiki to be a little more detailed though (https://github.com/Marak/Faker.js/wiki).

Work in process

A tale of two listeners. For some reason, I can't update the listitems object and the pattern-specific data object with one listener. data.json doesn't care where it's changed, but these other two get operated on in different places.

Developing

Use the following to install dev dependecies:

PATTERLAB_PLUGIN_DEV=@g749/plugin-node-faker npm install