npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

paste-escaped

v1.1.1

Published

Escapes pasted text based on where the cursor is positioned

Downloads

2

Readme

Paste Escaped

TypeScript Semantic Paste

(escapes pasted text based on where the cursor is positioned)

paste-escaped

Install

| Windows / Linux | Mac | | ------------------ | ----------------- | | ctrl+shift+x | cmd+shift+x |

  • Type Paste
  • Find Paste Escaped
  • Click the Install button
  • Click the Reload button

Usage

Paste with semantic escaping (TypeScript files only)

| Windows / Linux | Mac | | ------------------ | ----------------- | | ctrl+shift+v | cmd+shift+v |

Undo semantic escaping

| Windows / Linux | Mac | | ------------------ | ---------------- | | ctrl+z | cmd+z |

  • Press once to undo the escaping (leaving you with the raw clipboard text).

  • Press a second time to undo the entire paste operation.

Command Pallette

| Windows / Linux | Mac | | ------------------ | ----------------- | | ctrl+shift+p | cmd+shift+p |

  • Type Paste
  • Select the option Paste: Escaped

Features

Escapes clipboard text in the following scenarios with | being the cursor position:

:heavy_check_mark: const test = `|`;

:heavy_check_mark: const test = "|";

:heavy_check_mark: const test = '|';

:heavy_check_mark: const test = /|/g;

:heavy_check_mark: const test = 123; // |

:heavy_check_mark: const test = /* | */ 123;

:ok_hand: any.other.code | (no escaping)

How it works

Text in clipboard:

:clipboard:

<text property="${donteval}" folder="C:\temp"/>
<name first='John\`s' last="Tools"/>`

Example 1. Pasting into template

const abc = ``;

Result (without extension) :thumbsdown:

const abc = `<text property="${donteval}" folder="C:\temp"/>
<name first='John`s' last="Tools"/>`;

:warning: Considers ${donteval} a template variable (may not be intentional)

:heavy_multiplication_x: Replaces \t in the C:\\temp path with a literal TAB

:heavy_multiplication_x: Breaks the string immediately following John causing compilation errors

Result (with extension) :thumbsup:

const abc = `<text property="\${donteval}" folder="C:\\temp"/>
<name first='John\`s' last="Tools"/>`;

:heavy_check_mark: The ${donteval} exists as verbatim text and will not look for a variable named donteval

:heavy_check_mark: Does not replace part of the path with a TAB

:heavy_check_mark: The string ends where expected :astonished:

Example 2.

const def = "";

Result (without extension) :thumbsdown:

const def = "<text property="${donteval}" folder="C:\temp"/>
<name first='John`s' last="Tools"/>"

:heavy_multiplication_x: Breaks the string immediately following property= (and several other places) causing compilation errors

:heavy_multiplication_x: Adds a line break causing additional compilation errors

:heavy_multiplication_x: Replaces \t in the C:\\temp path with a literal TAB

Result (with extension) :thumbsup:

const def = "<text property=\"${donteval}\" path=\"C:\\temp\"/>\n<name first='John`s' last=\"Tools\"/>";

:heavy_check_mark: Escapes all quotes and backslashes (\)

:heavy_check_mark: Escapes the line break with \n (or \r\n if that were on the clipboard)

:heavy_check_mark: The string ends where expected

License

MIT