
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
append-children
Advanced tools
Append children to a DOM element.
With npm do:
npm install --save append-children
var appendChildren = require('append-children')
var element = document.createElement('div')
// append a single thing
appendChildren(element, document.createElement('p'))
// append multiple things
appendChildren(element, [
// other DOM elements
document.createElement('span'),
// strings and friends
'hello world',
123,
/regexes/gi,
new Date(),
// nested arrays of things to append
[[[someOtherElement()]]]
])
function someOtherElement() {
var hello = document.createElement('span')
appendChildren(hello, 'hello')
var world = document.createElement('strong')
appendChildren(world, 'world')
return [hello, ' ', world]
}
Append a DOM element child
to another DOM element element
.
Append a string str
to a DOM element element
.
A Text node will be created to contain the string.
RegExps, Dates and Numbers are converted to a string using toString()
.
Append multiple things to a DOM element element
.
arr
can be an array of any of the things accepted by the other forms.
FAQs
Append things to a DOM element.
We found that append-children 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
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.