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

fancy-data

v1.0.1

Published

JavaScript mockup data generation library

Downloads

6

Readme

FancyData

FancyData - JavaScript Mockup Data Generation Library

Install

npm install fancy-data

Include

<script src="/dist/bundle.min.js"></script>

CDN

<script src="https://cdn.fancygrid.com/fancydata.min.js"></script>

Sample

new FancyData({
  rows: 1000000,
  indexes: ['id', 'name', 'surname', 'country', 'position', 'email', 'age'],
  columns: [{
    type: 'id',
    index: 'id'
  },{
    type: 'name',
    index: 'name'
  },{
    type: 'surname',
    index: 'surname'
  },{
    type: 'country-rich',
    index: 'country'
  },{
    type: 'it-position',
    index: 'position'
  },{
    type: 'email',
    index: 'email',
    site: 'google.com'
  },{
    type: 'age',
    min: 20,
    max: 45,
    index: 'age'
  }]
}).getData({
  on1000: function(generated, percents, total){
    console.log(generated, percents, total)
  },
  onFinished: function(data){
    console.log('onFinished', data);
  }
});

Core Properties

| Name | Type | Description | | --- | --- | --- | | columns | Array | List with columns config | | indexes | Array | Data indexes, if not provided than it data could contain more options than columns | | rows | Number | Number of data rows |

Column types

age

Age range value from min and max values.
By default min is 0 and max is 100.

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | max | Number | | min | Number |

Sample
{
  type: 'age',
  min: 20,
  max: 45,
  index: 'age'
}

boolean

Boolean value true or false.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'boolean',
  index: 'married'
}

company

Random company from small list.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'company',
  index: 'company'
}

country

Random country from almost all countries list.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'country',
  index: 'country'
}

country-rich

Random rich country.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'country-rich',
  index: 'country'
}

date

Date value in format 'm.d.Y' by default between min 1970.1.1 and current date.

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | format | String | | min | Number | | max | Number |

Sample
{
  type: 'date',
  index: 'birthday',
  format: 'm/d/Y',
  min: new Date(1980, 1, 7)
}

email

Person email on base of 'name', 'surname', 'site'. 'site' is column property but name and surname must be extra columns.

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | tpl | String | | site | Number | | max | Number |

Sample
{
  type: 'email',
  index: 'email',
  site: 'google.com'
}

float

Float number value with presition between range.

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | presition | Number | | min | Number | | max | Number |

Sample
{
  type: 'float',
  index: 'bank_balance',
  presition: 2,
  min: 0,
  max: 150000
}

fortune100

Company from fortune 100 list.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'fortune100',
  index: 'company'
}

fortune500

Company from fortune 500 list.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'fortune500',
  index: 'company'
}

gender

Person gender, possible values: 'male'|'female'.
Requires extra column name.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'fortune500',
  index: 'company'
}

id

Incremental id value start from 1 by default.

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | min | Number |

Sample
{
  type: 'fortune500',
  index: 'company'
}

int

Integer number value between range.

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | min | Number | | max | Number |

Sample
{
  type: 'int',
  index: 'value',
  min: 1000,
  max: 100000
}

it-level

Proffesional person level.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'it-level',
  index: 'level'
}

it-position

Person position in tech sphere.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'it-level',
  index: 'level'
}

name

Person name.

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'name',
  index: 'name'
}

salary-year

Person salary per year in range

Properties

| Name | Type | | --- | --- | | type | String | | index | String | | min | Number | | max | Number |

Sample
{
  type: 'salary-year',
  index: 'salary'
}

surname

Person surname

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'surname',
  index: 'surname'
}

usa-state

Random USA state

Properties

| Name | Type | | --- | --- | | type | String | | index | String |

Sample
{
  type: 'usa-state',
  index: 'state'
}