🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

qw

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qw

Quoted word literals!

1.0.2
latest
Source
npm
Version published
Weekly downloads
167K
-34.26%
Maintainers
1
Weekly downloads
 
Created
Source

qw

Quoted word literals!

const qw = require('qw')

const myword = qw` this is
  a long list
  of words`
// equiv of:
const myword = [ 'this', 'is', 'a', 'long', 'list', 'of', 'words' ]

You can embed vars in the usual way:

const mywords = qw`product ${23 * 5} also ${'escaping a string'}`
// equiv of:
const mywords = [ 'product', 23 * 5, 'also', 'escaping a string' ]

You can also embed vars inside strings:

const mywords = qw`product=${23 * 5} also "${'escaping a string'}"`
// equiv of:
const mywords = [ 'product=' + (23 * 5), 'also', '"escaping a string"' ]

DESCRIPTION

This uses template strings to bring over this little common convenience from Perl-land.

FAQs

Package last updated on 14 Oct 2021

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