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

amock

v0.9.1

Published

Simplest data mock generator evaaaah.

Downloads

2

Readme

amock by @michalbe

Simplest data mock generator evaaaah.

// amock.js
var amock = require('amock');

amock('cities', {
  id: "id",
  name: "names:1"
});

amock('products', {
  id: "id",
  date_of_birth: "date",
  name: "words:1",
  description: "sentences:5",
  price: "random-number:9-100",
  image: "image:500/500",
  language: "random:['en-US', 'pl', 'de', 'fr']"
});

amock('movies', {
  id: "id",
  title: "names:1"
  director: { // nested objects allowed since amock0.9
    name: "names:2",
    age: "random-numbers:20-65"
  }
});

amock.get(); // TODO: concatenate the data, now it returns first data type only
amock.get('products', 100) // array of 100 products

Supported data types:

 'id' // autoincremented number, no argument
 'date' // random date from 1970-01-01 till now
 'words' // string, number of words as an argument
 'names' // capitalized string, number of names as an argument
 'sentences' // full sentence, number of sentences as an argument
 'random-number' // random number, range as an argument (min-max)
 'image' // link to the random image, resolution as an argument (width/height)
 'sequence:ARRAY' // each element will contain element of the array, so for
                  // `code: 'sequence:[1,2,3]'`` first element will contain 1,
                  // second 2, third 3, fourth 1, fifth 2, etc...
 'random:ARRAY' // each element will contain random element of the array

Usage

npm i amock -g
amock path-to-file-with-mock-description.json [number of elements, optional] > output