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 🙏

© 2025 – Pkg Stats / Ryan Hefner

export-comptable

v1.3.1

Published

A simple template of accounting summary

Downloads

32

Readme

export-comptable

This is an excel template of data build on top of excel4node

It's meant to generate xlsx file from Json

Setup

npm install export-comptable

test :

npm run test

Get started

workbook.write(); The write() method can accept a single filename, or an HTTP response object.

const exportComptable = require('export-comptable');

const workbook = exportComptable(data); //See data schema below

workbook.write('./ExcelFile.xlsx'); //To write in a file.

//Or to write in a HTTP response object
var express = require('express');
var app = express();
app.get('/', function (req, res) {
    workbook.write('ExcelFile.xlsx', res);
});
app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
});

workbook.writeToBuffer();
The writeToBuffer() returns a promise that resolves with the node buffer.


workbook.writeToBuffer().then(function (buffer) {
	// Do something with buffer
});

Data schema

const data = {
  startDate : "dd/mm/yyyy hh:mm",  //String
  endDate : "dd/mm/yyyy hh:mm",  //String
  clientName : "Nom du Client",   //String
  all : {
    HTRevenue : 0,                //Number
    TTCRevenue : 0,               //Number
    packageServiceHTRevenue : 0,  //Number (Revenue package + Service)
    technicHTRevenue : 0,         //Number (percent of package + Service)
    resaleHTRevenue : 0,          //Number
    VATTotal : 0,                 //Number
    packageServiceTTCRevenue : 0, //Number
    technicTTCRevenue : 0,        //Number
    resaleTTCRevenue : 0,         //Number
    averageHTCart : 0,            //Number
    averageTTCCart : 0,           //Number
    averageResaleTTCCart : 0,     //Number
    bankedTickets : 0,            //Number
    refundedTickets : 0,          //Number
    discountAmount : 0,           //Number
    soldServicesPackage : 0,      //Number
    soldProducts : 0,             //Number
  },
  payments : {
    creditCard : {amount : 0, number : 0},  //Both Number
    cash : {amount : 0, number : 0},        //Number
    check : {amount : 0, number : 0},       //Number
    giftCard : {amount : 0, number : 0},    //Number
    others : {amount : 0, number : 0},      //Number
    total : {amount : 0, number : 0},       //Number
  },
  details :{
    services :[
      {
        name : "Barbe", //String
        sold : 3,       //Number
        CAHT : 24,      //Number
        VAT : 6,        //Number
        CATTC : 30      //Number
      }],
    resales : [
      {
        name : "accessoires", //String
        sold : 4,             //Number
        CAHT : 32,            //Number
        VAT : 8,              //Number
        CATTC : 40            //Number
      }]
  },
  tickets :[{
    id: 0,                      //String
    date : "dd/mm/yyyy hh:mm",  //String
    totalTTC : 0,               //Number
    payment : 'Carte Bleue',    //String (Carte Bleue, Espèces, Chèque, Carte cadeau, Autres)
    clientName : "Jean-piétro", //String
    state : "Remboursé"         //String (Confirmé, Annulé, Remboursé)
  }],
  closures :[{
    openDate : "dd/mm/yyyy hh:mm",  //String
    closeDate : "dd/mm/yyyy hh:mm", //String
    amount : 0                      //Number
  }],
  collaborators :[{
    name:"Nom du collab1",  //String
    tickets : 0,            //Number
    serviceHTRevenue : 0,   //Number
    technicHTRevnue : 0,    //Number
    resaleHTRevenue : 0,    //Number
    totalTVA : 0,           //Number
    totalTTC : 0,           //Number
  }],
  cash:[{
    date: "dd/mm/yyyy hh:mm",         //String
    reason : "to conquer the world",  //String
    amount : 6.66,                    //Number
  }]
}

updating 1.2 -> 1.3


  data : {
    ...
    cash : [{                           //added
      date: "dd/mm/yyyy hh:mm",         //String
      reason : "to conquer the world",  //String
      amount : 6.66,                    //Number
    }]
  }