dot-todo-parser
v1.0.0
Published
Parse, convert, and write Todo files
Maintainers
Readme
dot-parser
NPM package for parsing Todo files.
Features roadmap:
- [x] parses Todo files
- [ ]
in progressconvert to JSON - [ ]
in progressconvert to CSV/TSV - [ ]
in progresswrites Todo file
Getting started
Installation
npm install dottodo-parserParsing
Parse a Todo file into an array of tasks:
const fs = require('fs');
const tp = require('todo-parser');
const todoAsText = fs.readFileSync('./todo.md');
const todo = tp.parse(todoAsText);
// Example value of 'todo':
// [
// {
// title: 'Some title',
// done: false,
// tags: ['some tag'],
// attributes: [
// {name: 'some name', value: 'some value'}
// ],
// parent: null,
// children: []
// }
// ]Tasks have the following properties:
titledone: whether the prefix box is ticked ([x]) or not ([ ])tagsattributes: array of{name: string, value: string}parent: index, in the array, of the parent task, ie the one with a smaller indentation in the Todo file.nullif no parentchildren: indices, in the array, of childrent tasks
