</>PackageGraphPackageGraph

locate-character

npmv3.0.0TypeScript

Get 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

5.2 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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 }
Example truncated — see the full README.

locate-character vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
locate-characterthis page01MIT3 years ago
index-to-position01MIT1 day ago
string-width03MIT1 day ago
indent-string94M2MIT1 day ago
get-east-asian-width69.3M1MIT1 day ago
detect-newline01MIT1 day ago

Dependencies

Declared by locate-character v3.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (2)

dts-buddy ^0.1.6typescript ^5.1.3

Used by

Popular packages that depend on locate-character.

Relationship graph

Dependencies (left) and dependents (right) of locate-character.

sveltelocate-character
locate-character dependencies dependents

Frequently installed together

Release history

No releases in the last two years, typically about 48 days apart.

Recent versions of locate-character
VersionPublishedSizeLicense
3.0.0latest3 years ago5.2 KBMIT
2.0.58 years agoMIT
2.0.48 years agoMIT
2.0.38 years agoMIT
2.0.28 years agoMIT
2.0.19 years agoMIT
2.0.010 years agoMIT
1.0.010 years agoMIT

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

Keywords

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.