Giter Site home page Giter Site logo

fony's Introduction

fony

fony is a simple command line tool that generates dummy JSON data from a provided template.

The application utilizes Chance.js under the hood so any data type supported by Chance.js is supported by fony.

fony is intended to provide a simple solution to the most common data generation needs. You can use the command line to pipe output from fony to other tools and integrate it into your workflow.

Installation

npm install --global fony

Usage

  Usage: fony [options]

  Options:

    -h, --help                 output usage information
    -V, --version              output the version number
    -t, --template <template>  JSON template for data to be generated
    -c, --count [count]        The number of elements to create, defaults to 1

Example

Mac and Linux folks can use single quotes around a double-quoted string of JSON like this:

fony -t '{"name": "name", "age": "age", "address": "address"}' -c 2

But Windows handles quotes on the command line differently, so be sure to escape your strings and only use double quotes:

fony -t "{\"name\": \"name\", \"age\": \"age\", \"address\": \"address\"}" -c 2

Niceties

fony supports nested fixtures:

$ fony -t '{"foo": {"bar": "name"}}'
{
  "foo": {
    "bar": "Virgie Davidson"
  }
}

As well as arrays:

$ fony -t '{"tags": ["word", 3]}'
{
  "tags": [
    "oklu",
    "odikabi",
    "coan"
  ]
}

fony

fony's People

Contributors

captainsafia avatar n1k0 avatar shanselman avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.