1.0.6 • Published 2 years ago

swtf-parser v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SWTF Parser

License: MIT npm npm type definitions swtf

Javascript library that parses SWTF into JSON

⚠️ This project is created to meet the needs of our development team. Our main focus currently won't be on maintainig this project.

Content

Installation

Install swtf-parser via npm:

npm i swtf-parser

Usage

Simple tasks

Here's an simple example:

const { parseSwtf } = require('swtf-parser');

const tasks = parseSwtf('- Define format that can be so simple and used acrossed devices\n');

console.log(JSON.stringify(tasks, null, 4));

This code should output:

[
    {
        "text": "Define format that can be so simple and used acrossed devices",
        "attributes": [],
        "subTasks": [],
        "level": 0
    }
]

Tasks with attributes

Here's an example of task with attributes:

const { parseSwtf } = require('swtf-parser');

const tasks = parseSwtf('- Define format that can be so simple and used acrossed devices [member: 👽][⚡]\n');

console.log(JSON.stringify(tasks, null, 4));

This code should output:

[
    {
        "text": "Define format that can be so simple and used acrossed devices",
        "attributes": [
            {
                "name": "member",
                "index": 0,
                "value": "👽"
            },
            {
                "name": null,
                "index": 1,
                "value": "⚡"
            }
        ],
        "subTasks": [],
        "level": 0
    }
]

Simple task list

An example of task list:

const { parseSwtf } = require('swtf-parser');

const rawTasks = `
- Daily tasks 😐:
    - store: [borring]
        - food [😅]
        - coffee [✅]
    - work: [borring]
        - include e2e testing mechanism [p: medium][😅]
        - improve load testing [p: high][😅]
    - write today's tasks in SWTF [cool][✅]
`;

const tasks = parseSwtf(rawTasks);

console.log(JSON.stringify(tasks, null, 4));

This code should have same output as simple-task-list.json

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago