Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pinpoint

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pinpoint

Display an arrow in a string of code to point to a location

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
534K
decreased by-6.32%
Maintainers
1
Weekly downloads
 
Created
Source

pinpoint

Add line numbers and an arrow to a string of code that points to a specific location.

Installation

npm install pinpoint

Example

With this code:

function add(left, right) {
  return left + right;
}

console.log(add(1 + 1));

When being asked to point to line 2 and column 2, generates this:

1| function add(left, right) {
2|   return left + right;
-----^
3| }
4|
5| console.log(add(1 + 1));

API

var pinpoint = require('pinpoint');

var str = pinpoint(code, options);
  • code - a string of code
  • options - an object literal supports these options:
    • line - the line number to point to, 1-based.
    • column - the column number to point to, 1-based.
    • showLines - the number of lines to show. The pointed line will try to stay in the middle of the displays lines.
    • indent - indent string prepend to each line, before the line number.
    • tabSize - width of a tab character.

Keywords

FAQs

Package last updated on 21 Sep 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc