common file names conventions
app.js, server.js, index.js
index.js : contains code for server side logic. index.js is the server code file
commands
npm run build: will run utilities to build and bundle javascript files if possible. After generating the bundle.js, be sure to include it in a script tag in the HTML file.
npm run start
The request module has been deprecated. Many web API requests make use of this module. Using this module will throw errors. MDN Fetch API "This kind of functionality was previously achieved using XMLHttpRequest. Possible alternative: Fetch provides a better alternative that can be easily used by other technologies such as Service Workers. Fetch also provides a single logical place to define other HTTP-related concepts such as CORS and extensions to HTTP." https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch Mozilla MDN
- console logging error
- console.error('error message or code')
- console log warning message in JavaScript
- console.warn('message')
- console logging time
- console.time('label') // print out time with the label
- console.timeEnd('label') measure how long the script takes
- https://developer.mozilla.org/en-US/docs/Web/API/Console/timeLog
- clear console
- console.clear()
- Print out complex console log message in table structures, returns a nice table
- console.table({object key : value})
No comments:
Post a Comment