SkillAgentSearch skills...

Jsonrawtoxlsx

jsonrawtoxlsx is library to convert json raw (array) into xlsx file

Install / Use

/learn @syukronarie/Jsonrawtoxlsx
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

<h1 align="center">Welcome to jsonrawtoxlsx 👋</h1> <p align="center"> <img src="https://img.shields.io/npm/v/jsonrawtoxlsx.svg?orange=blue" /> <a href="https://www.npmjs.com/package/jsonrawtoxlsx"> <img alt="downloads" src="https://img.shields.io/npm/dm/jsonrawtoxlsx.svg?color=blue" target="_blank" /> </a> <a href="https://github.com/syukronarie/jsonrawtoxlsx/blob/main/LICENSE"> <img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-yellow.svg" target="_blank" /> </a> <a href="https://codecov.io/gh/syukronarie/jsonrawtoxlsx"> <img src="https://codecov.io/gh/syukronarie/jsonrawtoxlsx/branch/main/graph/badge.svg" /> </a> <a href="https://snyk.io/test/npm/jsonrawtoxlsx"> <img alt="snyk.io" src="https://snyk.io/test/npm/jsonrawtoxlsx/badge.svg" target="_blank" /> </a> </p>

✨ What is jsonrawtoxlsx?

jsonrawtoxlsx is library to convert json raw (array) into xlsx file

⚡️ Installation

using npm

npm install jsonrawtoxlsx

using yarn

yarn add jsonrawtoxlsx

using pnpm

pnpm add jsonrawtoxlsx

🚀 Usage

Use to save as file:

const jsonrawtoxlsx = require('jsonrawtoxlsx');
const fs = require('fs');

const json = [
  {
    name: 'John',
    age: 27,
    job: 'Software Engineer',
  },
];

const buffer = jsonrawtoxlsx(json);

fs.writeFileSync('example.xlsx', buffer, 'binary');

Or use as express middleware. It adds a convenience xlsx method to the response object to immediately output an excel as download.

const express = require('express');
const jsonrawtoxlsx = require('jsonrawtoxlsx');
const app = express();
const PORT = 3000;

const data = [
  {
    name: 'John',
    age: 27,
    job: 'Software Engineer',
  },
  {
    name: 'John',
    age: 27,
    job: 'Software Engineer',
  },
];

app.use(jsonrawtoxlsx.middleware);
app.get('/', function (req, res) {
  res.xlsx('example.xlsx', data);
});

app.listen(PORT, function (err) {
  if (err) console.log(err);
  console.log('Server listening on PORT', PORT);
});

🤝 Contributing

Anyone can contribute with issues and PRs. If you're submitting a pull request, always create a new branch to work your changes, and try squashing commits down if possible. Always test any new code and make sure npm test passes and npm run test:cover for code coverage is adequate before opening a PR.

Author

👤 Arie Syukron

Show your support

Please ⭐️ this repository if this project helped you!

<a href="https://www.patreon.com/syukronarie"> <img src="https://c5.patreon.com/external/logo/become_a_patron_button@2x.png" width="160"> </a>

📝 License

Copyright © 2024 Arie Syukron.<br /> This project is MIT licensed.

happy coding!

View on GitHub
GitHub Stars19
CategoryDevelopment
Updated1y ago
Forks1

Languages

JavaScript

Security Score

80/100

Audited on Jan 28, 2025

No findings