Gathering detailed insights and metrics for unist-util-stringify-position
Gathering detailed insights and metrics for unist-util-stringify-position
Gathering detailed insights and metrics for unist-util-stringify-position
Gathering detailed insights and metrics for unist-util-stringify-position
utility to serialize a node, position, or point as a human readable location
npm install unist-util-stringify-position
Typescript
Module System
Node Version
NPM Version
99.5
Supply Chain
99.4
Quality
78
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
2,505,036,684
Last Day
901,752
Last Week
15,987,680
Last Month
68,955,032
Last Year
682,980,065
MIT License
6 Stars
101 Commits
2 Forks
8 Watchers
1 Branches
12 Contributors
Updated on Feb 01, 2024
Minified
Minified + Gzipped
Latest Version
4.0.0
Package Id
unist-util-stringify-position@4.0.0
Unpacked Size
12.87 kB
Size
4.25 kB
File Count
7
NPM Version
9.7.2
Node Version
20.0.0
Published on
Jul 07, 2023
Cumulative downloads
Total Downloads
Last Day
-6.9%
901,752
Compared to previous day
Last Week
-8.3%
15,987,680
Compared to previous week
Last Month
3.4%
68,955,032
Compared to previous month
Last Year
24.1%
682,980,065
Compared to previous year
1
unist utility to pretty print the positional info of a node.
This package is a utility that takes any unist (whether mdast, hast, etc) node, position, or point, and serializes its positional info.
This utility is useful to display where something occurred in the original document, in one standard way, for humans. For example, when throwing errors or warning messages about something.
This package is ESM only. In Node.js (version 16+), install with npm:
1npm install unist-util-stringify-position
In Deno with esm.sh
:
1import {stringifyPosition} from 'https://esm.sh/unist-util-stringify-position@4'
In browsers with esm.sh
:
1<script type="module"> 2 import {stringifyPosition} from 'https://esm.sh/unist-util-stringify-position@4?bundle' 3</script>
1import {stringifyPosition} from 'unist-util-stringify-position' 2 3stringifyPosition({line: 2, column: 3}) // => '2:3' (point) 4stringifyPosition({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1' (position) 5stringifyPosition({ 6 type: 'text', 7 value: '!', 8 position: { 9 start: {line: 5, column: 11}, 10 end: {line: 5, column: 12} 11 } 12}) // => '5:11-5:12' (node)
This package exports the identifier stringifyPosition
.
There is no default export.
stringifyPosition(node|position|point)
Serialize the positional info of a point, position (start and end points), or node.
node
(Node
)
— node whose position
fields to serializeposition
(Position
)
— position whose start
and end
points to serializepoint
(Point
)
— point whose line
and column
fields to serializePretty printed positional info of a node (string
).
In the format of 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
.
This package is fully typed with TypeScript. It exports no additional types.
Projects maintained by the unified collective are compatible with maintained versions of Node.js.
When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
unist-util-stringify-position@^4
, compatible with Node.js 16.
This project is safe.
unist-util-generated
— check if a node is generatedunist-util-position
— get positional info of nodesunist-util-remove-position
— remove positional info from treesunist-util-source
— get the source of a value (node or position) in a fileSee 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.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
security policy file detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
no SAST tool detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-23
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More