Giter Club home page Giter Club logo

node-fs-todo's Introduction

Node File IO Example: Creating A To Do List

In this example, we're creating a to-do list app that will work in the command line. In the basic version we only want to maintain one todo list. We must be able to:

  1. Add new tasks to the list
  2. Delete tasks from the list
  3. Mark existing tasks as complete
  4. Unmark a task as complete

A solution can be found on the branch basic-example.

The master branch, has a more complex example where we can maintain several todo lists.

Exercise Objectives, Simple Version

  • Build a to-do list app that modifies an existing .json file
  • Inside the todo list are tasks added from our app.
  • We should be able to read the todo list file and add, update, or delete tasks within.

Educational Objectives

This example is created to orient you on how the Node File System (FS) Module comes together to do something purposeful. The example uses FS to read files (readFile) and write to files (writeFile) to solve problems you will most likely encounter in the wild.

Key topics in this example include:

  • Running Node scripts in terminal
  • Using a Node Module
  • Reading, writing to, and creating files with Node FS Module
  • Understanding the async reading
  • Parsing files
  • Code structure and organization
  • Callbacks

Getting started

  • Clone to your local machine
  • In your local app folder, type sudo npm install
  • See what you have so far by running node src/app.js
  • Write your code in the files inside the src folder

node-fs-todo's People

Contributors

zubaird avatar eddyk92 avatar tebba-von-mathenstein avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.