node package manager
Easy collaboration. Discover, share, and reuse code in your team. Create a free org »

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.