Git Product home page Git Product logo

random-excel-gen's Introduction

Random excel data generator

The Random Excel Generator is a Utility tool built with Node.js that generates an excel file based on passed rules.

Install

npm install random-excel-gen

Usage

const randomExcelGen = require("random-excel-gen");
randomExcelGen([{
        heading:"heading1", 
        rule:"words" 
    },{
        heading:"heading2",
        rule:"randomDate"
    }],10,"two.xlsx");

Input

  • excelRules : An array of objects containing the excel column heading, rule, and raw data.
  • excelRows : The number of rows to populate with random data in the excel sheet.
  • path : The path where the excel sheet should be saved. If no path is provided, it will save the sheet as 'output.xlsx' in the root directory.

Excel Rules

It is an array of excel rules. Each rule object contains,

  • heading : Heading of the excel column
  • rule : Rule for the excel column

Rules

  • "words" : generates random words.
ex: {
       heading:"heading2",
       rule:"words"
   } 

Note: you can define explicit file named "randomWords.txt" and provide words seperated by space to override it ex:'lorem ipsum etc'


  • "randomAlphaNumber:length" : generates random alphabets+numbers with specified length.
ex: {
       heading:"heading2",
       rule:"randomAlphaNumber:10"
   } 

  • "randomNumber:length" : generates random numbers with specified length.
ex: {
       heading:"heading2",
       rule:"randomNumber:10"
   } 

  • "date" : generates random date.
ex: {
       heading:"heading2",
       rule:"date"
   } 

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.