@jsdoc-data/signale v0.0.3
Signale JSDoc Library
JSDoc types & metadata for
signale
This repo is an experiment in providing JSDoc typedefs
, @callback
(i.e. function typedefs) and all other JSDoc data as files which can be easily
included from an npm
module.
This makes it possible to import Signale
as a type, or {@link module:signale.LoggerDefinition} in a project.
(Enforcing is up to the build system, i.e. typescript can analyze JSDoc headers)
require('@jsdoc-data/signale')
/**
* Enumerated in JSDoc output with all possible values; verified prior to
* runtime by typescript (& tslint)
*
* @param {module:signale.LoggerDefinition} def - logger definition
* @returns {Signale} logger
*/
const getLogger = def => new Signale(def)
TODO
- Polish (potentially standardize theme w/ other repos)
Features
Full JSDoc data types for everything signale
related; Specifically:
- {@link module:signale.Configuration} - type configuration object for global/local logger(s)
- {@link module:signale.ConstructorParameters} - type passed to {@link module:signale.Signale~constructor}
- {@link module:signale.LoggerDefinition} - type passed optionally within {@link module:signale.ConstructorParameters}
- {@link module:signale.LoggerInput} - type representing data which may be given to a logger function; Click for details.
- {@link module:signale.LogLevel} - type that is an enum of valid log levels
(i.e.
module:signale.LogLevel.warn
), all configured levels areObject.keys(module:signale.LogLevel)
- {@link module:signale.MessageObject} - type of an object representing a log message, can be passed to logger methods i.e. {@link module:signale..await}
- {@link module:signale.TimerData} - type of data received from timer methods i.e.
signale.timeEnd()
{@link module:signale.Signale~timeEnd} - All
signale.*
{@link module:signale.} instance methods are available to JSDoc as module:signale.Signale~METHOD i.e. {@link module:signale.Signale~await}
What is Signale
A convenient and well-designed CLI logging library for
Node.JS, a much more flexible alternative to the classic debug
.
Official Signale API Documentation
Refer to the official signale docs for full documentation.
Experimental Warning
This repo is an experiment, and if succesful more will follow. If deemed useless it will be deleted/deprecated
Getting Started
yarn add @jsdoc-data/signale
Import the types that you need for your local JSDoc generation; if you would like to have a {@link module:signale.MessageObject} type available & expanded by JSDoc, then use the following:
require('@jsdoc-data/signale/data/message_object')
/**
* Some function
*
* @param {module:signale.MessageObject} msg - expanded by JSDoc
* @returns {number} res
*/
const (msg) => { … }
You may also import all metadata at once via:
require('@jsdoc-data/signale')
The {@link module:signale.MessageObject} type will be clickable in your documentation and link to a full table with all underlying options and their information (optional, etc). For more information refer to the JSDoc documentation
Disclaimer
This repo contains only JSDoc comment blocks and basic module logic. If you are looking for a console logger, you probably need signale.
Documentation
Refer to docs/dist/index.html
for full JSDoc-generated
documentation, hosted via Github Pages at
http://f3rno.github.io/@jsdoc-data/signale.
Basic Markdown docs are at /docs/md/index.md
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request