
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
`cal-vals` is an npm package designed to manage **changing values** over time. It provides a robust and traceable way to handle values whose changes are fully auditable and can be recalculated for any given point in time. This library is particularly usef
cal-vals
is an npm package designed to manage changing values over time. It provides a robust and traceable way to handle values whose changes are fully auditable and can be recalculated for any given point in time. This library is particularly useful for scenarios where historical data tracking and value regeneration are critical.
The library supports two types of values:
npm install cal-vals
const { CalVal, Model } = require('cal-vals');
The Model
class allows you to define the structure of your data.
const myModel = new Model({
name: 'exampleModel',
fields: ['field1', 'field2', 'field3']
});
The CalVal
class provides all the functionality for managing and auditing value changes.
const calVal = new CalVal(myModel);
// Add a value with a timestamp
calVal.addValue('field1', 100, new Date('2023-01-01'));
// Update the value at a later time
calVal.addValue('field1', 150, new Date('2023-02-01'));
// Retrieve the value at a specific point in time
const valueAtTime = calVal.getValue('field1', new Date('2023-01-15'));
console.log(valueAtTime); // Output: 100
// Audit all changes to a field
const auditLog = calVal.getAuditLog('field1');
console.log(auditLog);
Model
new Model(config)
config
: An object defining the model's name and fields.getFields()
: Returns the list of fields in the model.CalVal
new CalVal(model)
model
: An instance of the Model
class.addValue(field, value, timestamp)
: Adds or updates a value for a specific field at a given timestamp.getValue(field, timestamp)
: Retrieves the value of a field at a specific timestamp.getAuditLog(field)
: Returns the audit log of all changes for a specific field.Contributions are welcome! Please submit a pull request or open an issue on the GitHub repository.
This project is licensed under the TBD.
Special thanks to all contributors and users who have supported the development of this library.
FAQs
`cal-vals` is an npm package designed to manage **changing values** over time. It provides a robust and traceable way to handle values whose changes are fully auditable and can be recalculated for any given point in time. This library is particularly usef
We found that cal-vals demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.