locate-character
npmv3.0.0TypeScriptGet the line and column number of a specific character in a string
Not recommended for new projects
No — locate-character should not be adopted for new projects. Last published 1182 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 1182 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 5.2 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding locate-character to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- ESM only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the locate-character README.
import { locate } from 'locate-character';
const sample = `
A flea and a fly in a flue
Were imprisoned, so what could they do?
Said the fly, "let us flee!"
"Let us fly!" said the flea.
So they flew through a flaw in the flue.
`.trim();
// Using a character index
const index = sample.indexOf('fly');
locate(sample, index);
// -> { line: 0, column: 13, character: 13 }locate-character vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| locate-characterthis page | 0 | 1 | MIT | 3 years ago |
| index-to-position | 0 | 1 | MIT | 1 day ago |
| string-width | 0 | 3 | MIT | 1 day ago |
| indent-string | 94M | 2 | MIT | 1 day ago |
| get-east-asian-width | 69.3M | 1 | MIT | 1 day ago |
| detect-newline | 0 | 1 | MIT | 1 day ago |
Dependencies
Declared by locate-character v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (2)
Used by
Popular packages that depend on locate-character.
Relationship graph
Dependencies (left) and dependents (right) of locate-character.
Frequently installed together
An extremely fast JavaScript and CSS bundler and minifier.
ECMAScript parser
TypeScript definitions for estree
Next generation testing framework powered by Vite
Programmatic access to information about the AXObject Model
Gets the job done when JSON.stringify can't
Uses export conditions to return environment information in a way that works with major bundlers and runtimes.
Determine whether an AST node is a reference
Acorn plugin that parses TypeScript
TypeScript definitions for trusted-types
A tiny (239B) utility for constructing className strings conditionally.
A tool for walking ASTs
Release history
No releases in the last two years, typically about 48 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 3.0.0latest | 3 years ago | 5.2 KB | MIT |
| 2.0.5 | 8 years ago | — | MIT |
| 2.0.4 | 8 years ago | — | MIT |
| 2.0.3 | 8 years ago | — | MIT |
| 2.0.2 | 8 years ago | — | MIT |
| 2.0.1 | 9 years ago | — | MIT |
| 2.0.0 | 10 years ago | — | MIT |
| 1.0.0 | 10 years ago | — | MIT |
Overview
locate-character is an npm package that get the line and column number of a specific character in a string. It has 1 known dependents in the graph. The latest version is 3.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need get the line and column number of a specific character in a string and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Lean dependency tree (2 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use locate-character?
No — locate-character should not be adopted for new projects. Last published 1182 days ago.
How do I install locate-character?
Run `npm install locate-character` to add locate-character to your npm project.
What license is locate-character released under?
locate-character is distributed under the MIT license.
How popular is locate-character?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on locate-character.
Is locate-character still maintained?
The most recent release of locate-character (v3.0.0) was published 3 years ago.
Does locate-character run install scripts?
No. locate-character does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.