Skip to content

Instantly share code, notes, and snippets.

@jaohaohsuan
Last active June 9, 2017 06:59
Show Gist options
  • Save jaohaohsuan/16e298a282b617543c1a68f4f6938074 to your computer and use it in GitHub Desktop.
Save jaohaohsuan/16e298a282b617543c1a68f4f6938074 to your computer and use it in GitHub Desktop.
nodejs syntax notes

declare classes in polo1.js

class Polo1 {
  constructor() {
    console.log('hi Polo1');
  }
}

exports.Polo1 = Polo1;

use it

const { Polo1 } = require('./polo1.js');

const polo1 = new Polo1();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment