0.0.5 • Published 4 years ago

@jsdoc-data/chalk v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

Chalk JSDoc Library

Heavily WIP; split from @jsdoc-data/signale which uses {@link ChalkColor} Chalk types & metadata from chalk

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 chalk as a type, or use {@link ChalkColor} as a type to enforce only allowed colors.

(Enforcing is up to the build system, i.e. typescript can analyze JSDoc headers)

require('@jsdoc-data/chalk')

/**
 * Enumerated in JSDoc output with all possible values; verified prior to
 * runtime by typescript (& tslint)
 *
 * @param {ChalkColor} c - constrained color
 */
const doSomethingWithColor = c => { … }

TODO

  • Fill in rest of types/callbacks as needed
  • Polish (potentially standardize theme w/ other repos)

Features

Full JSDoc data types for everything chalk related

What is chalk

A utility for node.JS to colorize strings before rendering via a supported/capable Terminal, allowing for modification of both fg/bg colors in a few ways.

Official Chalk API Documentation

Refer to the official chalk 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/chalk

Import the types that you need for your local JSDoc generation; if you would like to have a {@link ChalkColor} type available & expanded by JSDoc, then use the following:

require('@jsdoc-data/chalk/enums/color')

/**
 * Some function
 *
 * @param {ChalkColor} c - user-supplied color string name
 * @returns {number} res
 */
const (c) => { … }

You may also import all metadata at once via:

require('@jsdoc-data/chalk')

The {@link ChalkColor} 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.

Documentation

Refer to docs/dist/index.html for full JSDoc-generated documentation, hosted via Github Pages at http://f3rno.github.io/@jsdoc-data/chalk. Basic Markdown docs are at /docs/md/index.md

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request
0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago