<commit_before># EDTF.js

[![Build Status](https://travis-ci.org/inukshuk/edtf.js.svg?branch=master)](https://travis-ci.org/inukshuk/edtf.js)
[![Coverage Status](https://coveralls.io/repos/github/inukshuk/edtf.js/badge.svg?branch=master)](https://coveralls.io/github/inukshuk/edtf.js?branch=master)
[![NPM version](https://img.shields.io/npm/v/edtf.svg)](https://www.npmjs.com/packages/edtf)
[![License AGPL-3.0](https://img.shields.io/npm/l/edtf.svg)](https://opensource.org/licenses/AGPL-3.0)

An Extended Date Time Format (EDTF) / ISO 8601-2 parser and toolkit for
date/time hackers and enthusiasts.

## Compatibility

### EDTF / ISO 8601-2
EDTF.js fully implements [EDTF](http://www.loc.gov/standards/datetime)
levels 0, 1, and 2 as specified by WD 2016-02-16 of ISO 8601-2 with
the following exceptions (as raised by the EDTF community):

1. Symbols for unknown and open dates in intervals have been switched:
   `*` makes more sense to represent an open date because it is often
   used as a wildcard to match "all" or "everything". Also, when an
   interval is blank, it suggessts "incomplete" or "unknown".

2. "Before or after" is redundant and has been removed. It is covered
   by "One of a Set", e.g., `[1760-12..]` which means "December 1760
   or some later month."

### ES6
EDTF.js is written in ES6 and therefore requires Node.js 6+ or a modern
browser. For Node.js 4/5 use the appropriate `--harmony` flags as necessary.


## Installation

    $ npm install edtf


## Manual

EDTF.js exports a top-level function which takes either a string
(with optional parser constraints), a parse result, a regular or any
of the extended date objects and returns a new, extended date object
as appropriate.

    const edtf = require('edtf')
<commit_msg>Add notes on bundling and experimental level 3<commit_after># EDTF.js

[![Build Status](https://travis-ci.org/inukshuk/edtf.js.svg?branch=master)](https://travis-ci.org/inukshuk/edtf.js)
[![Coverage Status](https://coveralls.io/repos/github/inukshuk/edtf.js/badge.svg?branch=master)](https://coveralls.io/github/inukshuk/edtf.js?branch=master)
[![NPM version](https://img.shields.io/npm/v/edtf.svg)](https://www.npmjs.com/packages/edtf)
[![License AGPL-3.0](https://img.shields.io/npm/l/edtf.svg)](https://opensource.org/licenses/AGPL-3.0)

An Extended Date Time Format (EDTF) / ISO 8601-2 parser and toolkit for
date/time hackers and enthusiasts.

## Compatibility

### EDTF / ISO 8601-2
EDTF.js fully implements [EDTF](http://www.loc.gov/standards/datetime)
levels 0, 1, and 2 as specified by WD 2016-02-16 of ISO 8601-2 with
the following exceptions (as raised by the EDTF community):

1. Symbols for unknown and open dates in intervals have been switched:
   `*` makes more sense to represent an open date because it is often
   used as a wildcard to match "all" or "everything". Also, when an
   interval is blank, it suggessts "incomplete" or "unknown".

2. "Before or after" is redundant and has been removed. It is covered
   by "One of a Set", e.g., `[1760-12..]` which means "December 1760
   or some later month."

3. Seasons in intervals are supported at the experimental/non-standard
   level 3.

### ES6
EDTF.js is written as a standard Nodes.js / CommonJS module using many ES6
features. It therefore requires Node.js 6 or later (for Nodes.js 4/5 use the
appropriate `--harmony` flags as necessary).

### Bundling using RollUp
To bundle EDTF.js with RollUp you'll need to enable the following plugins

* rollup-plugin-json
* rollup-plugin-node-resolve
* rollup-plugin-commonjs
* rollup-plugin-node-globals (optional)
* rollup-plugin-node-builtins (optional)

The last two are optional; you need them only if you want to include Node.js
`assert` in your bundle.

## Installation
    $ npm install edtf


## Manual

EDTF.js exports a top-level function which takes either a string
(with optional parser constraints), a parse result, a regular or any
of the extended date objects and returns a new, extended date object
as appropriate.

    const edtf = require('edtf')

{'fraction_non_alphanumeric': 0.11856435643564356, 'fraction_numerical': 0.02400990099009901, 'mean_word_length': 4.1022727272727275, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 16, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1389664', 'n_tokens_mistral': 1396, 'n_tokens_neox': 1291, 'n_words': 459}