Alex A. Naanou 054a3d3223 updated year
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
2023-09-09 16:33:58 +03:00
2023-06-12 12:44:21 +03:00
2022-08-02 17:34:58 +03:00
2022-08-02 17:34:58 +03:00
2023-09-09 16:33:58 +03:00
2022-08-02 17:34:58 +03:00
2023-09-09 16:33:58 +03:00

doc.js

dco.js is a set of basic helpers for formatting and writing in-code docs.

Contents

Installation

$ npm install ig-doc

Include the code, this is compatible with both node's and RequireJS' require(..)

var object = require('ig-doc')

normalizeIndent(..) / normalizeTextIndent(..) / doc / text

Align code to shortest leading white-space

normalizeIndent(<text>)
normalizeIndent(<text>, <tab-size>)
normalizeIndent(<text>, <tab-size>, <leading-tabs>)
	-> <text>

This is used to format .toString(..) return values for nested functions to make source printing in console more pleasant to read.

tab_size defaults to object.TAB_SIZE

leading_tabs defaults to object.LEADING_TABS

A shorthand to normalizeIndent(..) optimized for text rather than code

normalizeTextIndent(..)
	-> <text>

This ignores object.LEADING_TABS and leading_tabs is 0 by default.

doc and text are template string versions of normalizeIndent(..) and normalizeTextIndent(..) respectively.

License

BSD 3-Clause License

Copyright (c) 2016-2023, Alex A. Naanou,
All rights reserved.

Description
Basic JavaScript self-documentation utils...
Readme BSD-3-Clause 35 KiB
Languages
JavaScript 100%