todo-txt-parser
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.