Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jest-spreadsheet-loader

Package Overview
Dependencies
Maintainers
0
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-spreadsheet-loader

Jest transformer to parse xlsx files

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
278
increased by11.2%
Maintainers
0
Weekly downloads
 
Created
Source

Jest XLSX Loader

Build Status

Imports and parses xlsx files for usage with the xlsx npm module.

For webpack usage, see the webpack xlsx npm module.

Install

npm install --save-dev jest-xlsx-loader

Usage

Add this to your package.json. Note: babel-jest is only required if you want to continue transpiling js with babel.

"jest": {
  "transform": {
    "\\.jsx?$": "babel-jest",
    "\\.xlsx$": "jest-xlsx-loader"
  }
}

You can then directly import and use xlsx to manipulate your excel spreadsheet (if you need more complicated functionality).

import spreadsheet from './spreadsheet.xlsx'
import xlsx from 'xlsx'

test('that spreadsheet correctly imported', () => {
  expect(spreadsheet.SheetNames).toEqual(jasmine.arrayContaining([jasmine.any(String)]))

  const csvString = xlsx.utils.sheet_to_csv(spreadsheet.Sheets['Sheet1'])
})

License

MIT © Severin Ibarluzea

FAQs

Package last updated on 04 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc