Skip to content
Project template·Pro

To-do list in plain JavaScript

A to-do list in plain JavaScript modules. You can add items, edit them in place, tick them off, filter and clear them, and the list is saved in localStorage. The logic has tests for Node's test runner. It runs in the DevBrowser and on the app's own Node.js, without Linux.

You need PocketCode Pro to install it.

If PocketCode is installed on your Android device, this opens the page in the app.

Preview

Files

README.md
index.html
package.json
src/app.js
src/storage.js
src/todos.js
styles.css
test/todos.test.js

README.md

# To-do list in plain JavaScript A to-do list that runs in the browser with no framework and no build step: add, edit in place, tick off, filter and clear done items. The list is saved in the browser (localStorage). The logic lives in its own module with tests that run on Node's built-in test runner. ## Run it in PocketCode 1. Open `index.html` in the editor. 2. Tap the globe icon (DevBrowser) at the top of the editor. The app opens from the local preview server. 3. Add a few items and reload: they are still there. You don't need the Linux environment for this project. ## Run the tests - Open `test/todos.test.js` and tap Run. The app's own Node.js runs the file and prints each test with ok or not ok. - Or, in the terminal with the Linux environment and Node.js: `npm test`. ## Where things are | Path | What it does | |---|---| | `index.html` | The page and its form | | `styles.css` | Styles, with light and dark colours | | `src/todos.js` | The logic: plain functions, no DOM, easy to test | | `src/storage.js` | Saving and loading from localStorage | | `src/app.js` | Connects the page to the logic and draws the list | | `test/todos.test.js` | Tests for `src/todos.js` | ## Ideas to extend it - Add a due date: a new field in `addTodo`, a date input in the form and a test for it. - Drag to reorder: keep an `order` number on each item and sort by it in `visibleTodos`.

Changes in 1.0.0

First version.

Related

Node.js JSON API without dependenciesProProject templateA notes API on node:http: create, list, update and delete notes, with input checks and JSON errors, saved to a file. You don't install anything. Tap Run on server.js and the app's own Node.js starts it on localhost:3000. The project includes tests.Markdown static siteProProject templateWrite pages in Markdown and build them into a static HTML site with a shared layout and menu. The build is about 110 lines of Node.js you can edit, and its only package is marked. You open the result in the DevBrowser. The first npm install needs the Linux environment.Express + SQLite tasks APIProProject templateA tasks API on Express 5 with filtering, paging and tests. Data goes to node:sqlite, so nothing native has to compile. It needs the Linux environment with Node.js 22.13 or newer, and npm install fetches about 3.5 MB.Vite + React + TypeScriptProProject templateA habit tracker in React and TypeScript, built with Vite 8, with a weekly grid, streaks, a custom hook and a test. It needs the Linux environment with Node.js. The first npm install downloads about 25 packages (around 80 MB).Next.js + Tailwind + i18nProProject templateNext.js 15 project with next-intl and Tailwind CSS, and one page in English and Spanish at /en and /es. Dark mode follows the system. Needs the Linux environment with Node.js; the first npm install downloads around 400 MB.Static landing pageProProject templateA one-page site in plain HTML and CSS with a header and folding menu, a hero, a feature grid, an FAQ and a footer. Colours follow the system's light or dark setting. There is no build step and it doesn't need Linux: open index.html and tap the globe icon.