Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Functional, tiny, data-oriented, high performance ECS library written using JavaScript TypedArrays.
<3kb
gzippednpm i bitecs
import {
createWorld,
registerComponent,
registerComponents,
defineComponent,
defineQuery,
enterQuery,
exitQuery,
defineSystem,
addComponent,
removeComponent,
addEntity,
removeEntity,
pipe,
Types,
} from 'bitecs'
// create a world
const world = createWorld()
// define component data stores
const { f32 } = Types
const Vector2 = { x: f32, y: f32 }
const Position = defineComponent(Vector2)
const Velocity = defineComponent(Vector2)
const Health = defineComponent(f32)
const Alive = defineComponent() // "tag" component
// register components on world
registerComponents(world, [Position, Velocity, Health]) // in groups
registerComponent(world, Alive) // or individually
// define a query using components
const movementQuery = defineQuery([Position, Velocity])
// enter-query hook, called when an entity's components matches the query
enterQuery(world, movementQuery, eid => {})
// exit-query hook, called when an entity's components no longer matches the query
exitQuery(world, movementQuery, eid => {})
// define a system using the query
const movementSystem = defineSystem(movementQuery, ents => {
for (let i = 0; i < ents.length; i++) {
const eid = ents[i];
Position.x[eid] += Velocity.x[eid]
Position.y[eid] += Velocity.y[eid]
}
})
// add an entity to the world
const eid = addEntity(world)
// add components to the new entity in the world
addComponent(world, Position, eid)
addComponent(world, Velocity, eid)
// there are no component getters or setters
// data is accessed directly by entity ID
Velocity.x[eid] = 1
Velocity.y[eid] = 2
const pipeline = pipe(
movementSystem,
movementSystem,
movementSystem,
)
movementSystem(world) // executes movement system on world
pipeline(world) // executes a pipeline of systems on world
Full documentation and feature rich examples can be found here.
FAQs
Functional, minimal, data-oriented, ultra-high performance ECS library written in Javascript
The npm package bitecs receives a total of 828 weekly downloads. As such, bitecs popularity was classified as not popular.
We found that bitecs 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
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.