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.
- Host: GitHub
- URL: https://github.com/jstransformers/inputformat-to-jstransformer
- Owner: jstransformers
- License: mit
- Created: 2015-07-03T07:06:44.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2020-04-26T04:26:25.000Z (about 6 years ago)
- Last Synced: 2024-04-26T10:22:14.588Z (about 2 years ago)
- Language: JavaScript
- Homepage: http://npm.im/inputformat-to-jstransformer
- Size: 94.7 KB
- Stars: 5
- Watchers: 7
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- License: LICENSE.md
Awesome Lists containing this project
README
# inputformat-to-jstransformer
Load the first available [JSTransformer](https://github.com/jstransformers/jstransformer) from the provided `inputFormat`.
[](https://travis-ci.org/jstransformers/inputformat-to-jstransformer)
[](http://david-dm.org/jstransformers/inputformat-to-jstransformer)
[](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