
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
import Core from 'tnt-ecs';
import System from 'tnt-ecs';
import Entity from 'tnt-ecs';
import Component from 'tnt-ecs';
class Position extends Component {
getName() {
return 'position';
}
getDefaults() {
return {x: 0, y: 0};
}
}
class Color extends Component {
getName() {
return 'color';
}
getDefaults() {
return {r: 255, g: 255, b: 255};
}
}
class Rendering extends System {
test(entity) {
return entity.components.position && entity.components.color;
}
update(entity) {
console.log( entity.components.position.x, entity.components.position.x );
console.log( entity.components.color.r, entity.components.color.g, entity.components.color.b );
}
preUpdate() {
console.log('Before all entities are being updated');
}
postUpdate() {
console.log('After all entities are being updated');
}
enter(entity) {
console.log('Enter system', entity);
}
exit(entity) {
console.log('Exit system', entity);
}
}
const ecs = new Core();
const rendering = new Rendering();
ecs.addSystem(rendering);
// Start/stop the update loop
ecs.stop();
ecs.start();
// Start/stop the system
rendering.stop();
rendering.start();
// Add entities
ecs.addEntity(new Entity([
new Position(),
new Color()
]));
ecs.addEntity(new Entity([
new Position({x: 50}),
new Color({b: 20})
]));
ecs.addEntity(new Entity([
new Position({x: 50}),
new Color({r: 0, g: 0, b: 0})
]));
const camera = new Entity([
new Position({x: 50})
]);
// Removing / adding components
camera.addComponent(new Color());
camera.removeComponent('color');
camera.removeComponents(['position', 'color']);
if (camera.hasComponent('position')) {
console.log('This entity has the position component');
}
// Tagging
camera.tag('camera');
camera.removeTag('camera');
if (camera.hasTag('camera')) {
console.log('This entity has the camera tag');
}
FAQs
A basic Entity Component System implementation
The npm package tnt-ecs receives a total of 0 weekly downloads. As such, tnt-ecs popularity was classified as not popular.
We found that tnt-ecs 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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.