Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

roggy

0.1.2 • Public • Published

roggy

Install

yarn add roggy
# or 
npm install roggy

Programmatic Usage

Require the function call it with any of the following:

  • A remote branch name like master
  • A version number, like 3.0.0
  • A version number that starts with a v, like v1.0.0
  • A commit SHA, like 74603dec82800abe2f313d8edace189836d93432
  • A local directory, like ~/my/path/to/something-great

Also you need provide owner and repository. Example:

import { roggy } from 'roggy'
 
const docs = await roggy('master', {
  owner: 'electron',
  repository: 'electron',
})
docs.forEach((doc) => {
  // docs is an array of objects, one for each markdwon file in /docs
})

Each object in the array looks like this:

{
  slug'chromium-rce-vulnerability',
  filename'chromium-rce-vulnerability.md',
  markdown_content'---\ntitle: Chromium RCE Vulnerability Fix\nauthor: zeke\ndate: ' +
}

When fetchhing docs from a local directory, be sure to use a full path:

import * as path from 'path'
const docsPath = path.join(__dirname, 'docs')
 
roggy(docsPath, { owner: '', repository: '' }).then((docs) => {
  // ...
})

License

MIT

Install

npm i roggy

DownloadsWeekly Downloads

562

Version

0.1.2

License

MIT

Unpacked Size

93.1 kB

Total Files

14

Last publish

Collaborators

  • avatar