Coder Social home page Coder Social logo

help-me's Introduction

help-me

Help command for node, to use with minimist and commist.

Example

'use strict'

var helpMe = require('help-me')
var path = require('path')
var help = helpMe({
  dir: path.join(__dirname, 'doc'),
  // the default
  ext: '.txt'
})

help
  .createStream(['hello']) // can support also strings
  .pipe(process.stdout)

// little helper to do the same
help.toStdout(['hello'])

Using ESM and top-level await::

import { help } from 'help-me'
import { join } from 'desm'

await help({
  dir: join(import.meta.url, 'doc'),
  // the default
  ext: '.txt'
}, ['hello'])

Usage with commist

Commist provide a command system for node.

var commist = require('commist')()
var path = require('path')
var help = require('help-me')({
  dir: path.join(__dirname, 'doc')
})

commist.register('help', help.toStdout)

commist.parse(process.argv.splice(2))

Acknowledgements

This project was kindly sponsored by nearForm.

License

MIT

help-me's People

Contributors

alemagio avatar kamilogorek avatar khattakdev avatar marcelfranca avatar mcollina avatar simoneb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

help-me's Issues

Relies (transitively) on vulnerable version of inflight

Seems that inflight is not expected to be fixed (see this comment). So, the upstream libs using it should fix by updating to later versions of the in between dependency (glob).

For my app, the dependency chain starts with pino-pretty, but this help-me lib would be the point of upgrading to newer version of glob to resolve:

[email protected][email protected][email protected][email protected]

The Snyk issue, for reference:
https://security.snyk.io/vuln/SNYK-JS-INFLIGHT-6095116

Exact match option

I found that if the doc directory contains 2 files where one file has the name entirely contained in the other filename it is not possible (for what I could understand) to match the first one:

doc: hello.txt, hello-world.txt

It is not possible to get hello.txt

I opened a PR with a test and a possible fix creating a boolean option which, if true, makes it match exactly the entire file name so hello will only match hello.txt and hello-world will only match hello-world.txt.

Example not working

The current example ( example.js ) needs some modification in order to execute it successfully. I think it should be a ready-made example without any modification required.
Currently, if you try to execute it, you get the following error

image

With very little modification, this could be fixed.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.