1.0.0 • Published 6 years ago
dot-todo-parser v1.0.0
dot-parser
NPM package for parsing Todo files.
Features roadmap:
- parses Todo files
in progressconvert to JSONin progressconvert to CSV/TSVin 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
1.0.0
6 years ago