retext-stringify
Advanced tools
Comparing version
45
index.js
@@ -1,46 +0,13 @@ | ||
/** | ||
* @author Titus Wormer | ||
* @copyright 2014 Titus Wormer | ||
* @license MIT | ||
* @module retext:stringify | ||
* @fileoverview NLCST to text compiler. | ||
*/ | ||
'use strict'; | ||
/* eslint-env commonjs */ | ||
/* Dependencies. */ | ||
var toString = require('nlcst-to-string'); | ||
/** | ||
* Attacher. | ||
* | ||
* @param {unified} processor - Unified processor. | ||
* @param {Object?} [config={}] - Configuration. | ||
*/ | ||
function stringify(processor) { | ||
/** | ||
* Construct a new compiler. | ||
*/ | ||
function Compiler() {} | ||
module.exports = stringify; | ||
/** | ||
* Compile the bound file. | ||
* | ||
* @param {Node} tree - NLCST node. | ||
* @return {string} - text. | ||
*/ | ||
function compile(tree) { | ||
return toString(tree); | ||
} | ||
function stringify() { | ||
this.Compiler = compiler; | ||
} | ||
/* Expose methods. */ | ||
Compiler.prototype.compile = compile; | ||
/* Expose parser. */ | ||
processor.Compiler = Compiler; | ||
function compiler(tree) { | ||
return toString(tree); | ||
} | ||
/* Expose plugin. */ | ||
module.exports = stringify; |
{ | ||
"name": "retext-stringify", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "NLCST to text compiler for retext", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
# retext-stringify [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat] | ||
[Compiler][] for [**unified**][unified]. Stringifies an | ||
[**nlcst**][nlcst] syntax tree to text. Used in the [**retext** | ||
[**NLCST**][nlcst] syntax tree to text. Used in the [**retext** | ||
processor][processor]. | ||
@@ -24,7 +24,7 @@ | ||
process.stdin | ||
.pipe(unified()) | ||
.use(english) | ||
.use(emoji, {convert: 'encode'}) | ||
.use(stringify) | ||
.pipe(process.stdout); | ||
.pipe(unified()) | ||
.use(english) | ||
.use(emoji, {convert: 'encode'}) | ||
.use(stringify) | ||
.pipe(process.stdout); | ||
``` | ||
@@ -31,0 +31,0 @@ |
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2672
-20.24%9
-76.32%1
Infinity%