@lggruspe/todo-txt-parser
TypeScript icon, indicating that this package has built-in type declarations

1.1.1 • Public • Published

todo-txt-parser

GitHub Workflow Status codecov npm (scoped) GitHub

todo.txt parser for Typescript/Javascript.

Installation

npm install @lggruspe/todo-txt-parser

Usage

import { parse } from '@lggruspe/todo-txt-parser'
import { readFileSync } from 'fs'

const todo = readFileSync('todo.txt', 'utf8').trim()
const tasks = parse(todo)

Each Task contains the following fields.

interface Task {
  completed?: boolean
  priority?: string
  completion?: string
  creation?: string
  description?: string
  projects?: Array<string>
  contexts?: Array<string>
  pairs?: Array<[string, string]>
}

See examples/.

License

MIT.

Package Sidebar

Install

npm i @lggruspe/todo-txt-parser

Weekly Downloads

0

Version

1.1.1

License

MIT

Unpacked Size

564 kB

Total Files

21

Last publish

Collaborators

  • lggruspe