An open API service indexing awesome lists of open source software.

https://github.com/jstransformers/inputformat-to-jstransformer

Load a JSTransformer from the provided inputFormat.
https://github.com/jstransformers/inputformat-to-jstransformer

Last synced: 11 months ago
JSON representation

Load a JSTransformer from the provided inputFormat.

Awesome Lists containing this project

README

          

# inputformat-to-jstransformer

Load the first available [JSTransformer](https://github.com/jstransformers/jstransformer) from the provided `inputFormat`.

[![Build Status](https://img.shields.io/travis/jstransformers/inputformat-to-jstransformer/master.svg)](https://travis-ci.org/jstransformers/inputformat-to-jstransformer)
[![Dependency Status](https://img.shields.io/david/jstransformers/inputformat-to-jstransformer/master.svg)](http://david-dm.org/jstransformers/inputformat-to-jstransformer)
[![NPM version](https://img.shields.io/npm/v/inputformat-to-jstransformer.svg)](https://www.npmjs.org/package/inputformat-to-jstransformer)

## Installation

npm install inputformat-to-jstransformer

## API

### `(inputFormat)`

Returns the first package available to process the given `inputFormat`; `false` if no package is available.

```js
var jstransformer = require('jstransformer')
var inputFormatToTransformer = require('inputformat-to-jstransformer')

var md = inputFormatToTransformer('md')
// => remarkable, markdown, markdown-it, marko, or supermarked

jstransformer(md).render('# Hello World!').body
// => '

Hello World!

'
```

### `.dictionary`

The [`dictionary.json`](dictionary.json) array is also available:

``` js
var inputFormats = require('inputformat-to-jstransformer').dictionary
if (inputFormats['tiff']) {
console.log('Input formats of Tiff are supported!')
}
```

## Update

To update `dictionary.json`, run:

```
npm run build
```

## License

MIT