Socket
Socket
Sign inDemoInstall

@coffeekraken/s-docmap

Package Overview
Dependencies
14
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coffeekraken/s-docmap


Version published
Weekly downloads
331
Maintainers
1
Created
Weekly downloads
 

Readme

Source

@coffeekraken/s-docmap

MIT 2.0.0-alpha.20 - Git repository

size downloads license discord

Powerful class that let you generate and read docmap.json file. A docmap.json file is a "directory" that lists all the documentation found in your code using docblocks and the "@namespace" tag.

Install

npm i @coffeekraken/s-docmap

SDocmap

This package expose a simple SDocmap class that let you read and generate a docmap.json file

What is a docmap

A docmap is nothing more that a json file that lists all of the documentation you can have inside your project.

When we say "documentation", it means meanly "docblocks" that you may have written in your source files.

Features

  • Search for files that have a @namespace docblock tag to list them into the generated docmap.json file
  • Allows you to read your docmap.json file
    • It will flatten the standard docmap.json structure to expose only map and menu properties
    • It will merge the extended docmaps
      • Extended docmaps are dependencies packages with a docmap.json at his root
  • Use through the sugar CLI
  • And more...

Usage

Here's a simple example how to use the SDocmap class:

import __SDocmap from '@coffeekraken/s-docmap';
const docmap = new __SDocmap();
await docmap.build();

And here's how to use the docmap through the sugar CLI:

# generate a docmap
sugar docmap.build
# read the docmap
sugar docmap.read

Settings

SDocmapSettingsInterface
customMenu

Specify some custom menu to generate for the docmap.

tagsProxy

Specify some proxy by tags. A proxy is a function that will be called with the corresponding tag data and return new data for the docmap.json file.

Build parameters

SDocmapBuildParamsInterface
globs
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75 Array

Specify some globs to use to search docblocks to use in docmap generation

exclude
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75 Array

Specify some regexp used to exclude files from resulting docMap

tags
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75 Array

Specify which docblock tags you want in your final docmap.json file

filters
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75 Array

Specify some properties and regex to use to filter docblocks

noExtends

Specify if you want to avoid searching for docmap.json files in the dependency packages

excludePackages
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75 Array

Specify some package(s) name(s) (glob) to exclude

save
1

Specify if you want to save the generated file under the ```outPath

    </dt>
        <dt class="s-font s-font--40 s-mbe s-mbe--30">
        <header class="s-flex s-bg s-bg--main-surface s-radius">
            <div class="s-flex-item s-flex-item--grow s-tc s-tc--accent s-p s-p--30 s-typo s-typo--strong">
                outPath             </div>
            <div class="s-typo s-typo--bold s-p s-p--30 s-tc s-tc--info"></div>
        </header>
                <div class="s-pi s-pi--30 s-mbs s-mbs--40">
            <div class="s-typo s-typo--code">/Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/core/s-docmap/docmap.json</div>
        </div>
                <p class="s-typo s-typo--p s-p s-p--30">Specify where you want to save the builded file. Usually saved in package root with the name docmap.json</p>
    </dt>
    </dl>

## Read parameters

<span class="s-typo s-typo--code">
    SDocmapReadParamsInterface
</span>

<dl>
        <dt class="s-font s-font--40 s-mbe s-mbe--30">
        <header class="s-flex s-bg s-bg--main-surface s-radius">
            <div class="s-flex-item s-flex-item--grow s-tc s-tc--accent s-p s-p--30 s-typo s-typo--strong">
                input             </div>
            <div class="s-typo s-typo--bold s-p s-p--30 s-tc s-tc--info"></div>
        </header>
                <div class="s-pi s-pi--30 s-mbs s-mbs--40">
            <div class="s-typo s-typo--code">/Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/core/s-docmap/docmap.json</div>
        </div>
                <p class="s-typo s-typo--p s-p s-p--30">Specify the input path to the docmap.json file to read</p>
    </dt>
        <dt class="s-font s-font--40 s-mbe s-mbe--30">
        <header class="s-flex s-bg s-bg--main-surface s-radius">
            <div class="s-flex-item s-flex-item--grow s-tc s-tc--accent s-p s-p--30 s-typo s-typo--strong">
                sort             </div>
            <div class="s-typo s-typo--bold s-p s-p--30 s-tc s-tc--info"></div>
        </header>
                <div class="s-pi s-pi--30 s-mbs s-mbs--40">
            <div class="s-typo s-typo--code">
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75
Array</div>
        </div>
                <p class="s-typo s-typo--p s-p s-p--30">Specify which of the docmap entries has to be sorted alphabetically.</p>
    </dt>
        <dt class="s-font s-font--40 s-mbe s-mbe--30">
        <header class="s-flex s-bg s-bg--main-surface s-radius">
            <div class="s-flex-item s-flex-item--grow s-tc s-tc--accent s-p s-p--30 s-typo s-typo--strong">
                sortDeep             </div>
            <div class="s-typo s-typo--bold s-p s-p--30 s-tc s-tc--info"></div>
        </header>
                <div class="s-pi s-pi--30 s-mbs s-mbs--40">
            <div class="s-typo s-typo--code">
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75
Array</div>
        </div>
                <p class="s-typo s-typo--p s-p s-p--30">Specify which of the docmap entries has to be sorted alphabetically AND deeply.</p>
    </dt>
        <dt class="s-font s-font--40 s-mbe s-mbe--30">
        <header class="s-flex s-bg s-bg--main-surface s-radius">
            <div class="s-flex-item s-flex-item--grow s-tc s-tc--accent s-p s-p--30 s-typo s-typo--strong">
                excludePackages             </div>
            <div class="s-typo s-typo--bold s-p s-p--30 s-tc s-tc--info"></div>
        </header>
                <div class="s-pi s-pi--30 s-mbs s-mbs--40">
            <div class="s-typo s-typo--code">
Warning: Array to string conversion in /Users/olivierbossel/data/web/coffeekraken/coffeekraken/packages/tools/sugar/vendor/twig/twig/src/Environment.php(358) : eval()'d code on line 75
Array</div>
        </div>
                <p class="s-typo s-typo--p s-p s-p--30">Specify some package(s) name(s) (glob) to exclude</p>
    </dt>
    </dl>

## API

For more information about the API, please check out [the API documentation](/api/@coffeekraken.s-docmap.node.SDocmap)


    <!-- license -->    
    ### License

    Distributed under the **MIT** License. See **[LICENSE](./license)** for more information.

    <!-- contact -->
    ### Contact

    Here's all the ways you can contact us listed:

        [![discord](https://img.shields.io/badge/Join%20us%20on%20discord-Join-blueviolet?style=[config.shieldsio.style]&amp;logo=discord)](https://discord.gg/HzycksDJ)
        [![email](https://img.shields.io/badge/Email%20us-Go-green?style=[config.shieldsio.style]&amp;logo=Mail.Ru)](mailto:olivier.bossel@gmail.com)
    

FAQs

Last updated on 15 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc