Javascript | Node.js Flashcards

1
Q

Setting up a Node.js project:

What is FS in node JS? E.g. when you declare this in the spec.helper.js file:

const fs = require(‘fs’);

A

The Node.js file system module allows you to work with the file system on your computer. To include the File System module, use the require() method: var fs = require(‘fs’);

Common use for the File System module:

Read files
Create files
Update files
Delete files
Rename files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Setting up a Node.js project:

What is Mocha? What is Node.js required with it?

A

Mocha is a JavaScript testing framework. It provides a lot of methods like describe, it, before, etc. to organise your tests. It provides both command line and programmatic utilities to execute the tests.

The Mocha test framework runs in a Node.js environment.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly