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

remark

Package Overview
Dependencies
Maintainers
1
Versions
49
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark - npm Package Compare versions

Comparing version 4.2.2 to 5.0.0

cli.js

25

index.js

@@ -6,3 +6,2 @@ /**

* @module remark
* @version 4.2.2
* @fileoverview Markdown processor powered by plugins.

@@ -15,22 +14,8 @@ */

/*
* Dependencies.
*/
/* Dependencies. */
var unified = require('unified');
var Parser = require('./lib/parse.js');
var Compiler = require('./lib/stringify.js');
var escape = require('./lib/escape.json');
var parse = require('remark-parse');
var stringify = require('remark-stringify');
/*
* Exports.
*/
module.exports = unified({
'name': 'mdast',
'Parser': Parser,
'Compiler': Compiler,
'data': {
'escape': escape
}
});
/* Expose. */
module.exports = unified().use(parse).use(stringify).abstract();

111

package.json
{
"name": "remark",
"version": "4.2.2",
"version": "5.0.0",
"description": "Markdown processor powered by plugins",

@@ -8,120 +8,31 @@ "license": "MIT",

"markdown",
"markup",
"abstract",
"syntax",
"tree",
"json",
"ast",
"parse",
"stringify",
"bin",
"cli"
"process"
],
"dependencies": {
"camelcase": "^2.0.0",
"ccount": "^1.0.0",
"chalk": "^1.0.0",
"chokidar": "^1.0.5",
"collapse-white-space": "^1.0.0",
"commander": "^2.0.0",
"concat-stream": "^1.0.0",
"debug": "^2.0.0",
"elegant-spinner": "^1.0.0",
"extend": "^3.0.0",
"glob": "^7.0.0",
"globby": "^4.0.0",
"log-update": "^1.0.1",
"longest-streak": "^1.0.0",
"markdown-table": "^0.4.0",
"minimatch": "^3.0.0",
"npm-prefix": "^1.0.1",
"parse-entities": "^1.0.0",
"repeat-string": "^1.5.0",
"stringify-entities": "^1.0.0",
"to-vfile": "^1.0.0",
"trim": "^0.0.1",
"trim-trailing-lines": "^1.0.0",
"unified": "^3.0.0",
"unist-util-remove-position": "^1.0.0",
"user-home": "^2.0.0",
"vfile": "^1.1.0",
"vfile-find-down": "^1.0.0",
"vfile-find-up": "^1.0.0",
"vfile-location": "^2.0.0",
"vfile-reporter": "^1.5.0",
"ware": "^1.3.0"
"remark-parse": "^1.0.0",
"remark-stringify": "^1.0.0",
"unified": "^4.1.1"
},
"homepage": "http://remark.js.org",
"repository": {
"type": "git",
"url": "https://github.com/wooorm/remark.git"
},
"repository": "https://github.com/wooorm/remark/tree/master/packages/remark",
"bugs": "https://github.com/wooorm/remark/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"contributors": [
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"Eugene Sharygin <eush77@gmail.com>",
"YJ Yang <chcokr@gmail.com>"
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)"
],
"bin": {
"remark": "bin/remark"
},
"directories": {
"man": "./man"
},
"engines": {
"node": ">=0.10.0"
"node": ">=0.11.0"
},
"files": [
"index.js",
"lib",
"man",
"bin"
"cli.js"
],
"devDependencies": {
"bail": "^1.0.0",
"browserify": "^13.0.0",
"clone": "^1.0.1",
"escodegen": "^1.7.0",
"eslint": "^2.0.0",
"esmangle": "^1.0.0",
"esprima": "^2.6.0",
"istanbul": "^0.4.0",
"jscs": "^2.0.0",
"jscs-jsdoc": "^1.0.0",
"mocha": "^2.0.0",
"remark-comment-config": "^3.0.0",
"remark-github": "^4.0.1",
"remark-html": "^3.0.0",
"remark-license": "^2.0.0",
"remark-lint": "^3.0.0",
"remark-man": "^3.0.0",
"remark-retext": "^1.0.1",
"remark-toc": "^3.0.0",
"remark-usage": "^3.0.0",
"remark-validate-links": "^3.0.0",
"remark-yaml-config": "^3.0.0",
"retext": "^2.0.0",
"retext-equality": "^2.2.1",
"retext-profanities": "^1.1.0",
"retext-readability": "^1.0.0",
"retext-simplify": "^1.1.0"
},
"scripts": {
"build-man": "bin/remark doc/*.?.md --config-path .remarkrc-man --quiet",
"build-md": "bin/remark . --quiet --frail",
"build-version": "node script/build-version.js",
"build-options": "node script/build-options.js",
"build-bundle": "node script/build-bundle.js",
"lint-api": "eslint .",
"lint-style": "jscs --reporter inline .",
"lint": "npm run lint-api && npm run lint-style",
"build": "npm run build-version && npm run build-md && npm run build-options && npm run build-man && npm run build-bundle",
"test-api": "mocha --check-leaks test/index.js",
"test-api-extensive": "TEST_EXTENDED=true npm run test-api",
"test-cli": "bash test/cli.sh",
"test-coverage": "istanbul cover _mocha -- -- test/index.js",
"test-travis": "npm run build-md && npm run build-bundle && npm run lint && npm run test-coverage && npm run test-cli",
"test": "npm run build && npm run lint && npm run test-coverage && npm run test-cli"
}
"bin": "cli.js",
"scripts": {}
}

@@ -1,40 +0,14 @@

# ![remark][logo]
# remark [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status] [![Chat][chat-badge]][chat]
[![Build Status][build-badge]][build-status]
[![Coverage Status][coverage-badge]][coverage-status]
[![Inline docs][docs-badge]][docs-status]
[![Chat][chat-badge]][chat]
The [**remark**][remark] processor is a markdown processor powered by
[plug-ins][plugins].
> **remark** recently changed its name from **mdast**. [Read more about
> what changed and how to migrate »][migrating]
* Interface by [**unified**][unified];
* [**mdast**][mdast] syntax tree;
* Parses markdown to the tree with [**remark-parse**][parse];
* [Plug-ins][plugins] transform the tree;
* Compiles the tree to markdown using [**remark-stringify**][stringify].
**remark** is a markdown processor powered by plugins. Lots of tests. Node,
io.js, and the browser. 100% coverage.
Don’t need the parser? Or the compiler? [That’s OK][unified-usage].
**remark** is not just another markdown to HTML compiler. It can generate,
and reformat, markdown too. Powered by [plugins][] to do
all kinds of things: [validate your markdown][remark-lint],
[add links for GitHub references][remark-github], or
[add a table of contents][remark-toc].
The project has both an extensive [JavaScript API][remark-3] for
parsing, modifying, and compiling markdown, and a friendly [Command Line
Interface][remark-1] making it easy to validate, prepare, and compile
markdown in a build step.
## Table of Contents
* [Installation](#installation)
* [Usage](#usage)
* [API](#api)
* [remark.process(value\[, options\]\[, done\])](#remarkprocessvalue-options-done)
* [remark.use(plugin\[, options\])](#remarkuseplugin-options)
* [CLI](#cli)
* [License](#license)
## Installation

@@ -48,186 +22,34 @@

[Read more about alternative ways to install and use »][install]
## Usage
Load dependencies:
```javascript
```js
var remark = require('remark');
var lint = require('remark-lint');
var html = require('remark-html');
var yamlConfig = require('remark-yaml-config');
```
var report = require('vfile-reporter');
Use plugins:
```javascript
var processor = remark().use(yamlConfig).use(html);
remark().use(lint).use(html).process('## Hello world!', function (err, file) {
console.error(report(file));
console.log(file.toString());
});
```
Process the document:
```javascript
var doc = processor.process([
'---',
'remark:',
' commonmark: true',
'---',
'',
'2) Some *emphasis*, **strongness**, and `code`.'
].join('\n'));
```
Yields:
```html
<ol start="2">
<li>Some <em>emphasis</em>, <strong>strongness</strong>, and <code>code</code>.</li>
</ol>
```
```txt
<stdin>
1:1 warning Missing newline character at end of file final-newline
1:1-1:16 warning First heading level should be `1` first-heading-level
1:1-1:16 warning Don’t add a trailing `!` to headings no-heading-punctuation
## API
[**Get Started with the API** »][start-api]
### `remark.process(value[, options][, done])`
Parse a markdown document, apply plugins to it, and compile it into
something else.
**Signatures**:
* `doc = remark.process(value, options?, done?)`.
**Parameters**:
* `value` (`string`) — Markdown document;
* `options` (`Object`) — Settings:
* `gfm` (`boolean`, default: `true`) — See [GitHub Flavoured Markdown](doc/remarksetting.7.md#github-flavoured-markdown);
* `yaml` (`boolean`, default: `true`) — See [YAML](doc/remarksetting.7.md#yaml);
* `commonmark` (`boolean`, default: `false`) — See [CommonMark](doc/remarksetting.7.md#commonmark);
* `footnotes` (`boolean`, default: `false`) — See [Footnotes](doc/remarksetting.7.md#footnotes);
* `pedantic` (`boolean`, default: `false`) — See [Pedantic](doc/remarksetting.7.md#pedantic);
* `breaks` (`boolean`, default: `false`) — See [Breaks](doc/remarksetting.7.md#breaks);
* `entities` (`boolean`, default: `false`) — See [Encoding Entities](doc/remarksetting.7.md#encoding-entities);
* `setext` (`boolean`, default: `false`) — See [Setext Headings](doc/remarksetting.7.md#setext-headings);
* `closeAtx` (`boolean`, default: `false`) — See [Closed ATX Headings](doc/remarksetting.7.md#closed-atx-headings);
* `looseTable` (`boolean`, default: `false`) — See [Loose Tables](doc/remarksetting.7.md#loose-tables);
* `spacedTable` (`boolean`, default: `true`) — See [Spaced Tables](doc/remarksetting.7.md#spaced-tables);
* `fence` (`"~"` or ``"`"``, default: ``"`"``) — See [Fence](doc/remarksetting.7.md#fence);
* `fences` (`boolean`, default: `false`) — See [Fences](doc/remarksetting.7.md#fences);
* `bullet` (`"-"`, `"*"`, or `"+"`, default: `"-"`) — See [List Item Bullets](doc/remarksetting.7.md#list-item-bullets);
* `listItemIndent` (`"tab"`, `"mixed"` or `"1"`, default: `"tab"`) — See [List Item Indent](doc/remarksetting.7.md#list-item-indent);
* `incrementListMarker` (`boolean`, default: `true`) — See [List Marker Increase](doc/remarksetting.7.md#list-marker-increase);
* `rule` (`"-"`, `"*"`, or `"_"`, default: `"*"`) — See [Horizontal Rules](doc/remarksetting.7.md#horizontal-rules);
* `ruleRepetition` (`number`, default: `3`) — See [Horizontal Rules](doc/remarksetting.7.md#horizontal-rules);
* `ruleSpaces` (`boolean`, default `true`) — See [Horizontal Rules](doc/remarksetting.7.md#horizontal-rules);
* `strong` (`"_"`, or `"*"`, default `"*"`) — See [Emphasis Markers](doc/remarksetting.7.md#emphasis-markers);
* `emphasis` (`"_"`, or `"*"`, default `"_"`) — See [Emphasis Markers](doc/remarksetting.7.md#emphasis-markers).
* `position` (`boolean`, default: `true`) — See [Position](doc/remarksetting.7.md#position);
* `done` (`function(Error?, string?)`) — Callback invoked when the output
is generated with either an error, or a result. Only strictly needed when
asynchronous plugins are used.
All options (including the options object itself) can be `null` or `undefined`
to default to their default values.
**Returns**:
`string` or `null`: A document. Formatted in markdown by default, or in
whatever a plugin generates.
The result is `null` if a plugin is asynchronous, in which case the callback
`done` should’ve been passed (do not worry: plugin creators make sure you know
its asynchronous).
### `remark.use(plugin[, options])`
Change the way [`remark`][api] works by using a [`plugin`][plugins].
**Signatures**:
* `processor = remark.use(plugin, options?)`;
* `processor = remark.use(plugins)`.
**Parameters**:
* `plugin` (`Function`) — A [**Plugin**][plugins];
* `plugins` (`Array.<Function>`) — A list of [**Plugin**][plugins]s;
* `options` (`Object?`) — Passed to plugin. Specified by its documentation.
**Returns**:
`Object`: an instance of Remark: The returned object functions just like
**remark** (it has the same methods), but caches the `use`d plugins. This
provides the ability to chain `use` calls to use more than one plugin, but
ensures the functioning of the **remark** module does not change for other
dependents.
## CLI
[**Get Started with the CLI** »][start-cli]
Install:
```bash
npm install --global remark
⚠ 3 warnings
<h2>Hello world!</h2>
```
Use:
## License
```text
Usage: remark [options] <pathspec...>
[MIT][license] © [Titus Wormer][author]
Markdown processor powered by plugins
Options:
-h, --help output usage information
-V, --version output the version number
-o, --output [path] specify output location
-c, --config-path <path> specify configuration location
-i, --ignore-path <path> specify ignore location
-s, --setting <settings> specify settings
-u, --use <plugins> use transform plugin(s)
-e, --ext <extensions> specify extensions
-w, --watch watch for changes and reprocess
-q, --quiet output only warnings and errors
-S, --silent output only errors
-f, --frail exit with 1 on warnings
-t, --tree input and output syntax tree
--file-path <path> specify file path to process as
--tree-out output syntax tree
--tree-in input syntax tree
--no-stdout disable writing to stdout
--no-color disable color in output
--no-rc disable configuration from .remarkrc
--no-ignore disable ignore from .remarkignore
See also: man 1 remark, man 3 remark,
man 3 remarkplugin, man 5 remarkrc,
man 5 remarkignore, man 7 remarksetting,
man 7 remarkconfig, man 7 remarkplugin.
Examples:
# Process `readme.md`
$ remark readme.md -o readme-new.md
# Pass stdin(4) through remark, with settings, to stdout(4)
$ remark --setting "setext: true, bullet: \"*\"" < readme.md > readme-new.md
# Use a plugin (with options)
$ npm install remark-toc
$ remark readme.md --use "toc=heading:\"contents\"" -o
# Rewrite markdown in a directory
$ remark . -o
```
<!-- Definitions -->
[logo]: https://cdn.rawgit.com/wooorm/remark/master/logo.svg
[build-badge]: https://img.shields.io/travis/wooorm/remark.svg

@@ -241,6 +63,2 @@

[docs-badge]: https://img.shields.io/badge/docs-A-brightgreen.svg
[docs-status]: http://inch-ci.org/github/wooorm/remark
[chat-badge]: https://img.shields.io/gitter/room/wooorm/remark.svg

@@ -250,28 +68,20 @@

[npm]: https://docs.npmjs.com/cli/install
[license]: LICENSE
[migrating]: https://github.com/wooorm/remark/releases/tag/3.0.0
[author]: http://wooorm.com
[remark-lint]: https://github.com/wooorm/remark-lint
[npm]: https://docs.npmjs.com/cli/install
[remark-github]: https://github.com/wooorm/remark-github
[remark]: https://github.com/wooorm/remark
[remark-toc]: https://github.com/wooorm/remark-toc
[unified]: https://github.com/wooorm/unified
[remark-1]: doc/remark.1.md
[mdast]: https://github.com/wooorm/mdast
[remark-3]: doc/remark.3.md
[parse]: https://github.com/wooorm/remark/blob/master/packages/remark-parse
[plugins]: doc/plugins.md
[stringify]: https://github.com/wooorm/remark/blob/master/packages/remark-stringify
[install]: doc/installation.md
[plugins]: https://github.com/wooorm/remark/blob/master/doc/plugins.md
[start-api]: doc/getting-started.md#application-programming-interface
[start-cli]: doc/getting-started.md#command-line-interface
[api]: #api
## License
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)
[unified-usage]: https://github.com/wooorm/unified#usage
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