Learn Simpli

Free Online Tutorial For Programmers, Contains a Solution For Question in Programming. Quizzes and Practice / Company / Test interview Questions.

Node js complete tutorial for beginners

Assert module in nodeJS

Assert module in nodeJS Introduction The assert module provides a set of assertion functions for verifying invariants We will learn the most used assertion functions Common assertion functions assert.deepEqual() assert.equal() assert.notDeepEqual() assert.notEqual() assert.deepEqual() Tests for deep equality between the actual and expected parameters Comparison details Primitive values are compared with…

Node js complete tutorial for beginners

Path module in nodeJS

Path module in nodeJS The path module provides utilities for working with file and directory paths console.log(path.posix.basename('/os.js')); console.log(path.dirname('/os.js')); console.log(path.extname('os.js')); console.log(path.isAbsolute('os.js')); console.log(path.normalize('os.js/..')); console.log(path.parse('os.js')); // os.js // / // .js // false // . // { root: '', dir: '', base: 'os.js', ext: '.js', name: 'os' }