Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
source-map-dummy
Advanced tools
Creates “dummy” source maps.
var createDummySourceMap = require("source-map-dummy")
createDummySourceMap(
["Hello", ",", " ", "World", "!"],
{source: "path/to/helloWorld.txt"}
)
// {
// file: "helloWorld.txt",
// version: 3,
// mappings: "...",
// sources: ["path/to/helloWorld.txt"],
// names: []
// }
createDummySourceMap(
"var foo = bar;",
{source: "path/to/foo.js", type: "js"}
)
// {
// file: "foo.js",
// version: 3,
// mappings: "...",
// sources: ["path/to/foo.js"],
// names: []
// }
npm install source-map-dummy
var createDummySourceMap = require("source-map-dummy")
createDummySourceMap(tokens, options)
Creates a “dummy” source map for tokens
, which is an array of strings. One
mapping will be added per token, except blank ones. Each mapping maps back to
itself.
First tokenize your source code into an array. Then pass that array to
createDummySourceMap
. This way it works with any type of source code.
In reality, source maps are only used for JavaScript and CSS. Therefore you may also pass a string of either JavaScript or CSS, that will be tokenized for you.
options
:
source
: Required. The path to the file containing code
. All mappings will
point to this source.type
: Required if tokens
is a string. Set it to js
if tokens
is a
string of JavaScript, and to css
if it is CSS.FAQs
Creates “dummy” source maps.
The npm package source-map-dummy receives a total of 129 weekly downloads. As such, source-map-dummy popularity was classified as not popular.
We found that source-map-dummy 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.