更新时间:2021-06-30 18:57:56
coverpage
Title Page
Packt Upsell
Why subscribe?
PacktPub.com
Contributor
About the author
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Conventions used
Get in touch
Reviews
Getting Set Up
Node.js installation
Node.js version confirmation
Installing Node
Verifying installation
What is Node?
Differences between JavaScript coding using Node and in the browser
Why use Node
Blocking and non-blocking software development
The working of blocking I/O
The working non-blocking I/O
Blocking and non-blocking examples using Terminal
Node community – problem solving open source libraries
Different text editors for node applications
Hello World – creating and running the first Node app
Creating the Node application
Running the Node application
Summary
Node Fundamentals – Part 1
Module basics
Using case for require()
Initialization of an application
The built-in module to use require()
Creating and appending files in the File System module
The OS module in require()
Concatenating user.username
Using template strings
Require own files
Making a new file to load other files
Exporting files from note.js to use in app.js
A simple example of the working of the exports object
Exporting the functions
Exercise – adding a new function to the export object
Solution to the exercise
Third-party modules
Creating projects using npm modules
Installing the lodash module in our app
Installation of lodash
Using the utilities of lodash
Using the _.isString utility
Using _.uniq
The node_modules folder
Global modules
Installing the nodemon module
Executing nodemon
Getting input
Getting input from the user inside the command line
Accessing the command-line argument for the notes application
Adding if/else statements
Exercise – adding two else if clauses to an if block
Getting the specific note information
Node Fundamentals – Part 2
yargs
Installing yargs
Running yargs
Working with the add command
Working with the list command
The read command
Dealing with the errors in parsing commands
The remove command
Fetching command
JSON
Converting objects into strings
Defining a string and using in app as an object
Converting a string back to an object
Storing the string in a file
Writing the file in the playground folder
Reading out the content in the file
Adding and saving notes
Adding notes
Adding notes to the notes array
Fetching new notes
Trying and catching code block
Making the title unique
Refactoring
Moving functionality into individual functions
Working with fetchNotes
Working with saveNotes
Testing the functionality
Node Fundamentals – Part 3
Removing a note