unist-util-position

WebJar for unist-util-position

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

unist-util-position
Last Version

Last Version

3.1.0
Release Date

Release Date

Type

Type

jar
Description

Description

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

Project URL

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

Source Code Management

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

Download unist-util-position

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

unist-util-position

Build Coverage Downloads Size Sponsors Backers Chat

unist utility to get the positional info of nodes.

Install

npm:

npm install unist-util-position

Use

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

var tree = remark().parse('# foo\n\n* bar\n')

console.log(position(tree))
console.log(position.start(tree))
console.log(position.end(tree))

console.log(position())
console.log(position.start())
console.log(position.end())

Yields:

{start: {line: 1, column: 1, offset: 0}, end: {line: 4, column: 1, offset: 13}}
{line: 1, column: 1, offset: 0}
{line: 4, column: 1, offset: 13}
{start: {line: null, column: null, offset: null}, end: {line: null, column: null, offset: null}}
{line: null, column: null, offset: null}
{line: null, column: null, offset: null}

API

position(node?)

Get the positional info of node (Node?). Returns Position.

position.start(node?)

position.end(node?)

Get the start or end points in the positional info of node (Node?). Returns Point.

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
3.1.0
3.0.3