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

json2excel-js

v1.1.0

Published

it helps export to excel, using column as Array or Object

Downloads

36

Readme

json2excel-js

It helps export to excel, using column as Array or Object.

The original porpose of it, is to help people who need to solve a problem bellow:

fields you sent:

fields: { 'label': 'Information title', 2019: 'information', 2020: 'information' }

P.S - The rows' orders doesnt matter

data: { 2019: 'information row', 2020: 'information row' label: 'information row', }

But the Object put Integer first, String at last. It's Sucks...

So, Why do not use Array ? Cuz sometimes i needn't repeat the same information at Object Keys and Values. therefore, now if you send:

fields: ["label", 2019, 2020]; <-- it will stay the same.

data: { 2019: 'information row', 2020: 'information row' label: 'information row', }

PS. the props 'fields' Accept Object and Array.

Well, solved my problem, hope it help u too.

How to Use

install the package

npm i json2excel-js

import the package

import downloadExcel from 'json2excel-js';

add on your components object

components: { downloadExcel }

Vue Page

<download-excel class="btn btn-default" # Class is optional :data="content.data" # data must be an Array of Objects :fields="translatedFields" # Array or Object :worksheet="tableName" # Name of your worksheet :name="${tableName}.xls" # Filename

<-- Here is your custom button -->
                <a
                    class="btn btn-sm btn-dark text-white"
                    style="cursor: pointer"
                    :title="$t('Exportar Para Excel')"
                >
                    <i class="fa fa-download"></i>
                </a>
<-- Be happy, good code -->