GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - mhulse/basic-node-module: Basic node module boilerplate using ES2018 async/await syntax.

This repository was archived by the owner on Nov 22, 2025. It is now read-only.
BranchesTags
Open more actions menu

Latest commit

 

History

4 Commits
4 Commits

Folders and files

NameName
Last commit message
Last commit date
.editorconfig
.editorconfig
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
index.js
index.js
 
 
install.sh
install.sh
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 
test.js
test.js
 
 

Repository files navigation

Basic Node module

Just experimenting with ECMAScript 2018 async/await class-based Node.js module.

Installation

$ bash <(curl -sL https://git.io/fhH5H)

Usage

After Installation, you can run this code like so:

$ npm i
$ node test.js
before
Hello world!
after

Feel free to wipe everything in index.js and start fresh … I just wanted an example to work with for when I start new modules.

Notes

I wanted to have the option of passing params via require AND method invocation:

const bnm = require('./index')({
  // Options can be passed here:
  red: 'black',
  green: 'purple',
});

// ...

let result = await bnm({
  orange: 'blue',
}).run();

Alternatively:

const bnm = require('./index')({
  // Options can be passed here:
  red: 'black',
  green: 'purple',
})();

// ...

let result = await bnm.run();

This was just an experiment, and I am guessing there may be a better way. Like I said before, this code is experimental.

License

Copyright © 2019 Michael Hulse.

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

About

Basic node module boilerplate using ES2018 async/await syntax.

Topics

boilerplatees2018experimentjavascript-classmoduletemplate

Resources

Readme
Apache-2.0 license
Activity

Stars

1 star

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.