0.0.5 • Published 5 years ago

extract-code-md v0.0.5

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

extract-code-md

Extract code from markdown block code.

Usage

const extract = require('extract-code-md')

const list = extract(
  `
# head1

Works
~~~javascript
1 + 2 // => 3
~~~

DO NOT works
~~~typescript
1 + 2 // => 3
~~~
`,
  {
    languages: ['js', 'javascript']
  }
)

list.length // => 1

Options

languages

the allowed languages for extracting.

  • Type: string[]
  • Default: ['js', 'javascript']