Professional Documents
Culture Documents
(6ASI) Week 3
(6ASI) Week 3
(6ASI) Week 3
6(ASI)
Week 4
Recap
Recap
Recap
Recap
We want to solve problems,
FAST!
WE ALL WANT TO END THE MISERY QUICKLY!
Advantages of using APIs
● Eliminates human-prone errors as much as possible
● Makes solution-delivery faster
○ Removes the overheads that manually requires more human
efforts to pull-off
● Enables programmers to focus on the problem
○ No longer need to build the tools
Node JS Modules
● Set of functions that are intended to be included in the application
● Comparable to Javascript libraries
○ E.g. importing packages/libraries
● Export:
○ Readies all of your functions to be used by other scripts by
providing the intended function names
● Import:
○ Includes the specified exported functions/packages in the
script
Open Source APIs
Node JS: NPM
● Is an online repository for the publishing
of open-source Node.js projects
● It is also a command-line utility for
interacting with said repository that aids in
package installation, version management,
and dependency management
● https://www.npmjs.com/
How NPM works
Start Here
How NPM works
How NPM works
How NPM works
How NPM works
NPM: Check For Documentation
● Example: Need for formatting dates
○ moment.js
○ https://www.npmjs.com/package/mome
nt
NPM: Check For Documentation
● Installation and usage/tutorials for
● https://momentjs.com/docs/
[Problem] Get all unique values
● Given a list/array
○ [1,1,1,2,2,3,3,3,4,4,5,5,5,1,6,7,6,7,8,7,9,8,8,9]