Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chipa

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chipa

Extract code snippets from md files.

  • 0.2.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

chipa

Codeship Status for Huemul/chipa

Easily extract code snippets from Markdown files.

Installation

$ yarn add chipa
# OR
$ npm install --save chipa

Usage

extractSingle

Position   :: { start: { column: Int, line: Int } }
Snippet    :: { lang: String, meta: String, value: String, position: Position }
FileResult :: { file: String, lang: String, snippets: [Snippet] }

extractSingle :: String -> String?|[String]? -> Promise(FileResult)

extractSingle(filePath: String, language?: String|[String])
  • filePath: file path.

  • language: the language to search for. If not provided will match every language.

const { extractSingle } = require('chipa')

extractSingle('README.md', ['js', 'javascript'])
  .then((result) => {
    // do stuff with the snippets
  })

extract

extract :: String -> String?|[String]? -> Promise([FileResult])

extract(glob: String, language?: String|[String])
  • glob: any valid node-glob pattern.

  • language: the language to search for. If not provided will match every language..

const { extract } = require('chipa')

extract('docs/*.md', 'go')
  .then((files) => {
    // doo stuff with the snippets
  })

Keywords

FAQs

Package last updated on 30 Oct 2017

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc