- gitignore
- node_modules/
- config.json & code.json
- .env & .npm
- authorization
- create an app on todoist to get client_id, client_secret
- set a redirect url for the app e.g. localhost:31234/auth (auth is a route i created and choose a random port)
- we are also running a server on this fixed-random-port, where we will get back the login data
- create an auth endpoint
- make a http request for authorization with client_id, permission and random-key
- this request is to opened in a browser after clicking
- it redirects with code as a query param, so I redirected to localhost at the port which I was running the server
- now with this code, try to get token for the user and then save that token locally
- application that uses token
- setup a middleware that checks if token is present or not
- all tasks and today tasks
- options module
- publishing to npm
- add this as first line in your index.js
- populate package.json with
- unique name
- version
- repository details
- keywords (optional)
- author
- bin with command name and entry point
-
npm login
-
npm publish
- notes
- create .env because it will pushed to npm hidden
- replaced file access with dirname + /filename