1.2.1 • Published 1 year ago

parsnip-ts v1.2.1

Weekly downloads
4
License
MIT
Repository
github
Last release
1 year ago

🌱 Parsnip-ts

Parser combinators written in and for TypeScript.

Getting Started

Installation

npm install parsnip-ts

Example

import { list, text } from 'parsnip-ts'
import { integer } from 'parsnip-ts/numbers'
import { ws } from 'parsnip-ts/whitespace'

const array = text('[')
  .and(list(integer, ws.and(text(',').and(ws)))
  .bind(integers =>
    text(']').map(() => integers)
  )

array.parseToEnd('[1, 2, 3]') // [1, 2, 3]

For a more thorough example, check out the examples folder.

1.2.0

1 year ago

1.2.1

1 year ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago