
Research
Supply Chain Attack on Axios Pulls Malicious Dependency from npm
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.
Generate a human-readable representation of a value. Focussed on producing clean and accurate depictions of data. Suitable for debugging and generating diffs.
const print = require("print");
let output = print({
foo: "bar",
baz: "quux",
list: [1, 2, 3, 4, "five"]
});
console.log(output);
print.out(obj); // Shortcut for console.log(print(obj));
print JSON.stringify util.inspect
{ { { foo: 'bar',
baz: "quux" "foo": "bar", baz: 'quux',
foo: "bar" "baz": "quux", list:
list: [ "list": [ [ 1,
1 1, 2,
2 2, 3,
3 3, 4,
4 4, 'five' ] }
"five" "five"
] ]
} }
print also handles circular references by showing a -> pointing to where the
object was first mentioned. For example, the following code:
const A = {};
const B = {foo: A};
print({A, B});
Will produce:
{
A: {}
B: {
foo: -> A
}
}
An optional second parameter can be passed to refine print's output.
Available options and their default values are listed below:
print(input, {
ampedSymbols: true,
escapeChars: /(?!\x20)\s|\\/g,
invokeGetters: false,
maxArrayLength: 100,
showAll: false,
showArrayIndices: false,
showArrayLength: false,
sortProps: true
});
Boolean
Prefix Symbol-keyed properties with @@. Disable to show Symbol(…) instead.
RegExp | Function
What characters, if any, are escaped in string values.
By default, anything that alters the output's meaning or layout is escaped:
\f \n \r \t \v \\
This can be overridden with a custom expression or callback, the latter of which receives the entire string as an argument.
Passing falsey values to escapeChars disables escaping altogether, which isn't
recommended if your input contains line-breaks or tabulation.
Boolean
Permit print to call a property getter to display its computed value.
Invoking a getter can have unwanted side-effects, so this option is disabled by default.
Number
Maximum number of array values to show before truncating them:
[
1
2
3
… 7 more values not shown
]
Note this excludes any named properties stored on the Array object:
const input = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
input.foo = "bar";
print(input, { maxArrayLength: 3 })
[
1
2
3
… 7 more values not shown
foo: "bar"
]
Boolean
Include non-enumerable properties when printing an object.
Note that inherited properties are always hidden.
Boolean
Show the index of each element in an array.
[ [
"A" 0: "A"
"B" -> 1: "B"
"C" 2: "C"
] ]
Boolean
Display an array's length property after its values:
[
"A"
"B"
"C"
length: 3
]
Boolean
Alphabetise the properties of printed objects.
To display properties in the order they were assigned, set this to false.
Note that alphabetisation is case-insensitive.
FAQs
Generate a human-readable representation of a value.
We found that print 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
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.

Security News
TeamPCP is partnering with ransomware group Vect to turn open source supply chain attacks on tools like Trivy and LiteLLM into large-scale ransomware operations.