node package manager
It’s your turn. Help us improve JavaScript. Take the 2017 JavaScript Ecosystem Survey »

babel-plugin-date-fns

babel-plugin-date-fns

Install

$ npm i --save date-fns
$ npm i --save-dev babel-plugin-date-fns

Example

Transforms

import { distanceInWordsToNow, differenceInYears, format } from 'date-fns';

roughly to

import distanceInWordsToNow from 'date-fns/distanceInWordsToNow';
import differenceInYears from 'date-fns/differenceInYears';
import format from 'date-fns/format';

Thanks

Heavily inspired by babel-plugin-lodash and babel-plugin-recharts.