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

tagged-template-noop

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tagged-template-noop

No-op function for tagged template literals.

  • 2.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Tagged template literal noop

npm

This module exports a single function that can be called with an ES2015 template string to have the same effect as not using any template function with your template literal.

const noopt = require('tagged-template-noop');

const qualifier = 'totally';

assert(
  noopt`Hopefully, I will be ${qualifier} useless.`
  ===  `Hopefully, I will be ${qualifier} useless.`
);

Possible uses include:

  • Expression-oriented programming style, e.g.:

    app.send((argv.escapeHtml ? escapeHtml : noopt)`
      <!doctype html>
      <html>
        <body>
          Hello ${form.username} !
        </body>
      </html>`
    );
    
  • Testing

  • Working around limited editor template literal content highlighting (e.g. to highlight GraphQL template strings in Vim)

Keywords

FAQs

Package last updated on 20 Jan 2020

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