Skip to content

Latest commit

 

History

History
101 lines (77 loc) · 3.68 KB

README.md

File metadata and controls

101 lines (77 loc) · 3.68 KB

Node.js examples from Lambert's book

Node.js project Directory samples_Lambert\ contains Node.js examples presented in Lambert's book "Node.js - Exploitez la puissance de JavaScript côté serveur" (ENI, 2015).
Github repository: https://github.com/vatesfr/eni-nodejs

04-concepts Example

Command npm.cmd start executes application app\async-downloads.js which produces the following output:

> npm start

> async-downloads@0.0.1 start N:\samples_Lambert\04-concepts\async-downloads
> node app/async-downloads.js

Tout s'est bien passé

06-files Example

Command npm.cmd run displays the available npm scripts.

> npm run
Scripts available in files via `npm run-script`:
  dirs
    node app/directories.js
  files
    node app/files.js
  lint
    eslint app
  paths
    node app/paths.js
  watch
    node app/watch.js

Command npm.cmd run dirs executes application app/directories.js:

> npm run dirs

> files@0.0.1 dirs N:\samples_Lambert\06-files
> node app/directories.js

fichiers trouvés : [ 'directories.js', 'files.js', 'paths.js', 'watch.js' ]
répertoire créé
répertoire supprimé
arborescence créée
arborescence supprimée

07-promises Example

Command npm.cmd run displays the available npm scripts:

> npm run
Scripts available in promises via `npm run-script`:
  creation
    node src/creation.js
  dl-two-files
    node src/dl-two-files.js
  generator
    babel src -d app & babel-node app/generator.js

10-databases Example

Command npm run displays the available npm scripts:

> npm run
Lifecycle scripts included in databases:
  start
    node app/mongoose.js
  test
    echo "Error: no test specified" && exit 1

available via `npm run-script`:
  clean
    node ./npm_scripts/clean.js
  lint
    eslint app
  reinstall
    npm run clean && npm install -audit

mics/November 2024