2.1.1 • Published 2 years ago

@ryanforever/help v2.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

HELP

add a nifty help function to your class to help users with its methods

const Thing = require("thing")
const thing = new Thing()

thing.help() // add a function that outputs method help to the console

usage

backend code

in your class or constructor function, add comments prefixed with //! over each method you want to show in the help log.

then, add a method called .help() or something, and assign it to the help function

const help = require("@ryanforever/help")

function MyClass() {
    
	//! returns hello world
	this.foo = async function() {
		...
	}
	
	//! summons ghost
	this.bar = async function() {
		...
	}
	
	//! important setting
	this.baz = 50
    
	this.help = help
}

client code

when a user instantiates your class and calls your help method, info about the methods will be logged to the console.

const MyClass = require("my-class")
const myClass = new MyClas()

myClass.help()

this will output the following:

╔══════════════════════════════╗
║         METHOD HELP          ║
║   here are the methods of    ║
║          "MyClass"           ║
║       /constructor.js        ║
╟────────┬─────────────────────╢
║ NAME   │ DESCRIPTION         ║
╟────────┼─────────────────────╢
║ .foo() │ returns hello world ║
╟────────┼─────────────────────╢
║ .bar() │ summons ghost       ║
╟────────┼─────────────────────╢
║ baz    │ important setting   ║
╚════════╧═════════════════════╝
2.1.1

2 years ago

2.1.0

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago