This repository adds Python-like DocStrings into Javascript!! Finally!!
This light-weight script takes advantage of the object-like datatypes in JavaScript by adding the .__doc__
property to ALL data types. I've personally tested it with:
- Arrays
- Objects
- Functions
- HTMLElements
- Strings
- Integers
- Booleans
this.__doc__ = "My example docstring"
this.setDocString("My docstring")
//returns "My docstring" (this.__doc__)
//Pass a variable name in arr[x][0] and the .__doc__ value at arr[x][1].
ds.setDocStrings(
[
[ myVar1, "docstring 1" ],
[ myVar2, "docstring 2" ]
]
)
If you plan on using, please give this repo a star :)