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

xlconverter

v2.0.0

Published

Nowdays everything is easly maintain if we are dealing with objects .As I have face many problems while in uploading excel file ,taking data from excel and play with each Cell of excel file .This Converter is just a interface which helps to get objects f

Downloads

98

Readme

Nowdays everything is easly maintain if we are dealing with objects .As I have face many problems while in uploading excel file ,taking data from excel and play with each Cell of excel file .This Converter is just a interface which helps to get objects from excel Or excel from objects.

link https://github.com/hardy12994/xlconverter

Here are the two Converters and Some Getters (define below) present in it :

  • Excel to Objects
  • Objects to Excel

Excel to Objects


let xlconverter = require('xlconverter');

 let path="abv/cac/ac/ac.xlsx";
 let sheet="sheet1";


 // xlToObjects, will provide objects of all the sheets present in xl sheet;

  xlconverter.xlToObjects(path, function (err, data) {
      console.log(err);
      console.log(data);
  });


 /**
 * data-
 *
 * [{},{},{}]
 * // object as rows
 */


 // xlToObjectsOfSheet, will provide objects of perticular sheet present in xl sheet;

  xlconverter.xlToObjectsOfSheet(path, sheet, function (err, data) {
      console.log(err);
      console.log(data);
  });

   /**
   * data -
   * {
   *   sheet1: [{},{},{}],
   *   sheet2: [{},{},{}]
   * }
   * // object as rows
   */
  

Objects to Excel


     let headers=["name","age"];
     let rows=[{ name:"hardy",age:21 },{ name:"hardy",age:21 }];
     let path="abc/cac/";
     let fileName="myNewSheet"; //.xlsx is by default
     let sheetName="sheet1";

     xlconverter.objectsToXl(headers, rows, path, fileName, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

      /**
      * if error -`sheetName` sheet not created
      * data -
      * `sheetName` sheet successfully created.
      */

Getters

We can use Excel Sheet as a very small Database as we can do Extractions from that by putting some queries, The query can be made in form of Objects, Arrays Thing can be achive like:

  • Any Perticular Row.
  • Any Perticular Column.
  • Get Number of Rows.
  • Get Number of Columns.
  • Get Data as Objects of Perticular Columns.

Get Row

  • Accept Query as Object Eg- {name:"Jhon",age:"21"}.
  • and type of query will be done.
  • Return Single Row which matches both Conditions First.

     let rowQuery= {name:"Jhon",age:"21"};
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.row(filePath, rowQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * {name:"Jhon", age:"21", f_name:"D_Jhon"}
    * // object as rows
    */

Get Rows

  • Accept Parameters as Object Eg- {name:"Jhon",age:"21"}.
  • and type of query will be done.
  • Return Multiple Rows which matches both Conditions.

     let rowQuery= {name:"Jhon",age:"21"};
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.rows(filePath, rowQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * [{name:"Jhon", age:"21", f_name:"D_Jhon"},
    * {name:"Jhon", age:"21", f_name:"D_Jhonee"}]
    * // object as rows
    */

Get Column

  • Accept Parameters as String Eg- "name".
  • Return Array of Strings which is Present in that Column.

     let colQuery= "name";
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.coloumn(filePath, colQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * ["Jhon","Jhon2","Jhon3"]
    * // as coloumn cells
    */

Get Columns

  • Accept Parameters as String in Array Eg- ["name","age"].
  • Return Object with Keys name and age and both of them have Array of Strings which is Present in respective Column.

     let colQuery= ["name","age"];
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.coloumns(filePath, colQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * {
    *  name:["Jhon","Jhon2","Jhon3"],
    *  age:[21,33,13]
    * }
    * // as coloumn cells
    */

Get Rows from Selective Columns

  • Accept Parameters as String in Array Eg- ["name","age"].
  • Return all Rows with Selected Columns name and age as Objects in Array
  • Getting Selective Coloumns of Rows.

     let colQuery= ["name","age"];
     let filePath="abc/cac/";
     let sheetName="sheet1";
     
     xlconverter.getters.selectiveColoumnsOfRows(filePath, colQuery, sheetName, function (err, data) {
         console.log(err);
         console.log(data); 
     });

    /**
    * data-
    *
    * [
    *   {name: "hardy", age: 12},
    *   {name: "pery", age: 41},
    *   {name: "bob", age: 42}
    *  ]
    * // 
    */

N O T E :

  • callback function is required in all methods.
  • getters are using xlToObjectsOfSheet function that's why sheet name is required.

Contributions are most wellcome