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

chimi

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chimi

Run JavaScript snippets from your markdown files

  • 0.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10
increased by150%
Maintainers
1
Weekly downloads
 
Created
Source

chimi

Run JavaScript snippets from your Markdown files.

How it works

chimi parses Markdown files and runs the JavaScript snippets to check if everything is alright.

Configuration

To let chimi find what snippets to run you have to indicate the code snippet language using either js or javascript like so:

```js
```javascript

You can configure chimi through an rc file, .chimirc:

{
  "dependencies": { 
    "trae": "trae",
    "lodash": "_",
    "./config": "config",
    "es6-promise: ""
  },
  "file": "readme.md",
  "timeout": 5000
}

NOTE: the .chimirc file has to be a valid JSON.

dependencies: object

A list of dependencies to be required on each snippet. Each key represents the path name and the value is the variable name, if the value is falsy (we recommend using an empty string) the require statement will be not assigned to a variable.

The depenencies in the example will generate these requires:

let trae   = require('trae')
let _      = require('lodash')
let config = require('./config')

require('es6-promise')

These dependencies will be added to your snippet before running it so you don't have to do it on every snippet.

file: string

Default: README.md.

The path to the file/s you want to parse. It can also be a glob. Be sure to specify only .md files.

timeout: number

Default: 5000.

The time, in miliseconds, to wait for the snippet execution before considering it a failure.

TODO

V1

  • CLI
    • Configuration (.chimi.js(on)?|.chimirc).
    • --help.
    • Log failures.

Future

  • CLI
    • Improve current interface. Jest like interface when running/watching.
    • Run multiple files.
  • Transpile with Babel. Check for project Babel config. (?)
  • Lint with Eslint. If project has Eslint configured.(?)
  • Environment. Use jsdom?
  • Snippet metadata. Using MD snippets flags (?)
  • Provide a programmatic API.

FAQs

Package last updated on 05 May 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