https://github.com/lggruspe/todo-txt-parser
todo.txt parser for Typescript/javascript
https://github.com/lggruspe/todo-txt-parser
javascript parser todotxt typescript
Last synced: 6 days ago
JSON representation
todo.txt parser for Typescript/javascript
- Host: GitHub
- URL: https://github.com/lggruspe/todo-txt-parser
- Owner: lggruspe
- License: mit
- Created: 2021-02-08T17:21:35.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-13T00:14:35.000Z (almost 5 years ago)
- Last Synced: 2025-10-24T05:19:04.716Z (4 months ago)
- Topics: javascript, parser, todotxt, typescript
- Language: TypeScript
- Homepage:
- Size: 294 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
todo-txt-parser
===============

[](https://codecov.io/gh/lggruspe/todo-txt-parser)


todo.txt parser for Typescript/Javascript.
Installation
------------
```bash
npm install @lggruspe/todo-txt-parser
```
Usage
-----
```javascript
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.
```typescript
interface Task {
completed?: boolean
priority?: string
completion?: string
creation?: string
description?: string
projects?: Array
contexts?: Array
pairs?: Array<[string, string]>
}
```
See `examples/`.
License
-------
MIT.