@f1stnpm2/beatae-vitae-laudantium

1.0.0Β β€’Β PublicΒ β€’Β Published

Welcome to @f1stnpm2/beatae-vitae-laudantium πŸ‘‹

downloads License: MIT snyk.io

✨ What is @f1stnpm2/beatae-vitae-laudantium?

@f1stnpm2/beatae-vitae-laudantium is library to convert json raw (array) into xlsx file

⚑️ Installation

using npm

npm install @f1stnpm2/beatae-vitae-laudantium

using yarn

yarn add @f1stnpm2/beatae-vitae-laudantium

using pnpm

pnpm add @f1stnpm2/beatae-vitae-laudantium

πŸš€ Usage

Use to save as file:

const @f1stnpm2/beatae-vitae-laudantium = require('@f1stnpm2/beatae-vitae-laudantium');
const fs = require('fs');

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

const buffer = @f1stnpm2/beatae-vitae-laudantium(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 @f1stnpm2/beatae-vitae-laudantium = require('@f1stnpm2/beatae-vitae-laudantium');
const app = express();
const PORT = 3000;

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

app.use(@f1stnpm2/beatae-vitae-laudantium.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!

πŸ“ License

Copyright Β© 2022 Arie Syukron.
This project is MIT licensed.

happy coding!

Package Sidebar

Install

npm i @f1stnpm2/beatae-vitae-laudantium

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

11.1 kB

Total Files

10

Last publish

Collaborators

  • sinhatminh11