Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Node #2

Open
newswim opened this issue Mar 14, 2017 · 0 comments
Open

Node #2

newswim opened this issue Mar 14, 2017 · 0 comments

Comments

@newswim
Copy link
Owner

newswim commented Mar 14, 2017

Core concepts

How do modules work?

basically, exports is an object which you can attach properties/methods to, just like any other object.. but the require function will parse a file and bind a matching keyword to a variable.

// lib.js

function sayHi () { return 'Hi' }

exports.sayHi = sayHi

// or..

exports.sayHi = function () { return 'Hi' }

// main.js
const sayHi = require('./lib').sayHi

You're simply accessing that property on the global object, module.exports (or exports, which its aliased to.)

NPM / Using Community Modules and Publishing To NPM

CLI

Processes

Asynchronous functions

  • Promises
  • Callbacks
  • Async/Await
  • Generators
  • Fibers/Coroutines

Node Debugger

Core modules (assert, crypto, http, event emitters)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant