What Is Node Js Typescript and NPM
What Is Node Js Typescript and NPM
js
1) executing JavaSript code
2) server-side scripting (employing scripts on a web server which produce a response
customized for each user's (client's) request to the website)
3) produce dynamic web page content before the page is sent to the user's web browser
4) event-driven architecture(design and implementation engineered to produce, detect,
consume, and react to significant changes of state)
5) Operates on Single Thread however has Asynchronous I/O (form on input/output
processing: permits other processing to continue before the transmission has
finished)
-Node.js uses an event loop for scalability, instead of processes or threads
TypeScript
1) strict syntactical superset of JavaScript-JavaScript programs are also valid
TypeScript programs
2) adds optional static typing and class-based object-oriented programming
3) development of large applications
4) Type annotations( provides static typing through type annotations to enable type
checking at compile time).
5) Type inference to infer types when types are not given. If no type can be inferred,
defaults to the dynamic any type
6) Declaration files. TypeScript script gets compiled there is an option to generate a
declaration file (with the extension .d.ts) interface to the components in the
compiled JavaScript. Compiler strips away all function and method bodies and
preserves only signatures of types that are exported.
7) Supports classes
8) Supports generics
-Namespaces: Utilize immediately-invoked function expression of JavaScript to encapsulate
code(!!!!!!!!).
-Module: leverage JavaScript library patterns to do so
NPM
1) package manager for the JavaScript
2) consists of a command line client(npm) is browsed and searched via the npm website
3) online database of public packages( npm registry) is accessed via the client
4) command line client that interacts with a remote registry
5) allows users to consume and distribute JavaScript modules that are available on the
registry
6) npm can manage packages that are local dependencies of a particular project, as well
as globally-installed JavaScript tools
7) provides version-bumping tools for developers to tag their packages with a particular
version
8) npm can install, in one command, all the dependencies of a project through the
package.json file.
9) In the package.json file, each dependency can specify a range of valid versions using
the semantic versioning scheme, allowing developers to auto-update their packages
while at the same time avoiding unwanted breaking changes.