Skip to content

lggruspe/todo-txt-parser

Repository files navigation

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.

About

todo.txt parser for Typescript/javascript

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published