Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
gremlin-template-string
Advanced tools
Generate Gremlin scripts with bound parameters using ES6 template strings
Generate Gremlin scripts with bound parameters using ES6 template strings.
Gremlin is a graph database query language used by the Apache TinkerPop framework.
Read the full Gremlin/TinkerPop3 documentation there: http://www.tinkerpop.com/docs/current/
$ npm install gremlin-template-string --save
Run tests with:
$ npm test
The module exports a single function (tag expression) which allows you to tag an ES6 template template string.
It will return an object with two properties:
script
: an escaped Gremlin stringparams
: a map (Object) of bound parameters (ie {p1: 'Foo', 'p2': 'Bar'}
)var gremlin = require('gremlin-template-string');
var who = 'Foobar';
var query = gremlin`
g.V('name', ${who}).out('follows').name
`
// query.script === "\n g.V('name', p1).out('follows').name\n"
// query.params.p1 === 'Foobar'
This library is heavily inspired by this blog post: http://www.ivc.com/blog/better-sql-strings-in-io-js-nodejs-part-2/. Thanks!
MIT
FAQs
Generate Gremlin scripts with bound parameters using ES6 template strings
We found that gremlin-template-string demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.