Skip to content

toufali/itemcount

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  • open root directory in console and type 'node index.js' or 'npm start'
  • allow user to supply a CLI argument containing a comma-separated list
    • if no argument is given, load tags.txt
  • count how many times each list item appears within the objects in data/*.json (note: objects can be nested).
  • final output should be formatted like this (sorted by most popular tag first):
pizza     15
spoon     2
umbrella  0
cats      0
  • cache the result so that subsequent runs can return the result immediately without needing to process the files.
  • use only core modules
  • use asynchronous variants of the file IO functions (eg. use fs.readFile not fs.readFileSync).
  • if any of the data files contain invalid JSON, log the error with console.error and continue, ignoring that file.
  • use latest version of node (at time of writing), but use plain callbacks instead of promises.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published