https://github.com/danieldiekmeier/todo-or-die
JavaScript version of https://github.com/searls/todo_or_die
https://github.com/danieldiekmeier/todo-or-die
Last synced: 10 months ago
JSON representation
JavaScript version of https://github.com/searls/todo_or_die
- Host: GitHub
- URL: https://github.com/danieldiekmeier/todo-or-die
- Owner: danieldiekmeier
- License: mit
- Created: 2019-02-17T13:29:56.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-04-30T18:25:12.000Z (over 2 years ago)
- Last Synced: 2025-01-15T10:12:23.503Z (11 months ago)
- Language: JavaScript
- Size: 39.1 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# TODO or Die!
A JavaScript version of [Searls' todo_or_die gem](https://github.com/searls/todo_or_die).
## Usage
```sh
npm i todo-or-die
```
Import it and use it:
```js
import todoOrDie from 'todo-or-die'
todoOrDie('Update after APIv2 goes live', new Date('2019-02-04'))
// For convenience, todo-or-die accepts `new Date()` compatible strings:
todoOrDie('Update after APIv3 goes live', '2019-02-05')
```
To understand why you would ever call a method to write a comment, [read Searls' explanation](https://github.com/searls/todo_or_die).
### What kind of error?
`todo-or-die` throws an `OverdueError` when your time's up. You can also `import { OverdueError } from 'todo-or-die'` if you need it.
### Custom Death
```js
todoOrDie.config.die = (message, by) => {
sendEmailToKaren('Oh no, Karen, your stuff broke')
}
// Reset it again!
todoOrDie.reset()
```