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

csv.macro

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

csv.macro

Compile CSV content to JSON at build-time with babel-plugin-macros.

  • 1.0.1
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

csv.macro

Compile CSV content to JSON at build-time with babel-plugin-macros.

Babel Macro Codecov Status npm package npm downloads prettier

inspired by graphql.macro

Installation

$ npm install csv.macro

Note: You'll need to install and configure babel-plugin-macros if you haven't already.

Note: It works by default is using create-react-app.

Usage

loader

import { loader } from 'csv.macro';
const jsonData = loader('./fixtures/data.csv');

      ↓ ↓ ↓ ↓ ↓ ↓

const jsonData = [
  {
    id: "1",
    username: "andrew",
    email: "andrew@example.com"
  },
  {
    id: "1",
    username: "luca",
    email: "luca@example.com"
  },
]

Development

Requirements

  • node >= 11.10.0
  • yarn >= 1.13.0
$ npm install --pure-lockfile

Test

$ npm run format
$ npm run eslint
$ npm run flow
$ npm run test:watch
$ npm run build

Publish

$ npm version patch
$ npm run changelog
git commit & push

CONTRIBUTING

  • ⇄ Pull requests and ★ Stars are always welcome.
  • For bugs and feature requests, please create an issue.
  • Pull requests must be accompanied by passing automated tests.

Keywords

FAQs

Package last updated on 09 Oct 2019

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