unist-util-stringify-position

WebJar for unist-util-stringify-position

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

unist-util-stringify-position
Last Version

Last Version

2.0.3
Release Date

Release Date

Type

Type

jar
Description

Description

unist-util-stringify-position
WebJar for unist-util-stringify-position
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/syntax-tree/unist-util-stringify-position

Download unist-util-stringify-position

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/unist-util-stringify-position/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>unist-util-stringify-position</artifactId>
    <version>2.0.3</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/unist-util-stringify-position/
implementation 'org.webjars.npm:unist-util-stringify-position:2.0.3'
// https://jarcasting.com/artifacts/org.webjars.npm/unist-util-stringify-position/
implementation ("org.webjars.npm:unist-util-stringify-position:2.0.3")
'org.webjars.npm:unist-util-stringify-position:jar:2.0.3'
<dependency org="org.webjars.npm" name="unist-util-stringify-position" rev="2.0.3">
  <artifact name="unist-util-stringify-position" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='unist-util-stringify-position', version='2.0.3')
)
libraryDependencies += "org.webjars.npm" % "unist-util-stringify-position" % "2.0.3"
[org.webjars.npm/unist-util-stringify-position "2.0.3"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : types__unist jar [2.0.2,3)

Project Modules

There are no modules declared in this project.

unist-util-stringify-position

Build Coverage Downloads Size Sponsors Backers Chat

unist utility to pretty print the positional information of a node.

Install

npm:

npm install unist-util-stringify-position

Use

var stringify = require('unist-util-stringify-position')

// Point
stringify({line: 2, column: 3}) // => '2:3'

// Position
stringify({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1'

// Node
stringify({
  type: 'text',
  value: '!',
  position: {
    start: {line: 5, column: 11},
    end: {line: 5, column: 12}
  }
}) // => '5:11-5:12'

API

stringifyPosition(node|position|point)

Stringify one point, a position (start and end points), or a node’s positional information.

Parameters
  • node (Node) — Node whose 'position' property to stringify
  • position (Position) — Position whose 'start' and 'end' points to stringify
  • point (Point) — Point whose 'line' and 'column' to stringify
Returns

string? — A range ls:cs-le:ce (when given node or position) or a point l:c (when given point), where l stands for line, c for column, s for start, and e for end. An empty string ('') is returned if the given value is neither node, position, nor point.

Related

Contribute

See contributing.md in syntax-tree/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

org.webjars.npm
🌲🌲🌲🌳🌲🌳🌲🌲🌲🌳🌳🌲🌲🌳🌲🌲🎄🌲🌳🌲🌲🌳🐻🌳🌳🌳🌲🌲🌳🌲🎄🌲🌳🌲🌲🌳🌳🌳

Versions

Version
2.0.3
2.0.2
2.0.1
1.1.2
1.1.1