
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
@reldens/utils
Advanced tools
Advanced event emitter with features like event sanitization, memory leak detection, key-based event management, and support for async/sync execution.
const { EventsManager } = require('@reldens/utils');
let eventsManager = new EventsManager();
// Listen to events
eventsManager.on('userLogin', (userData) => {
console.log('User logged in:', userData.username);
});
// Emit events
eventsManager.emit('userLogin', { username: 'player1', id: 123 });
// Listen with unique keys
eventsManager.onWithKey('gameStart', callback, 'uniqueKey');
eventsManager.offWithKey('uniqueKey'); // Remove by key
Spatial interaction validation helper that determines if objects are within interaction range based on coordinates and area margins.
const { InteractionArea } = require('@reldens/utils');
let interactionArea = new InteractionArea();
// Setup interaction area
interactionArea.setupInteractionArea(50, 100, 200); // margin=50, x=100, y=200
// Validate interaction
let isValid = interactionArea.isValidInteraction(120, 210); // true
let isInvalid = interactionArea.isValidInteraction(200, 300); // false
Advanced logging utility with multiple log levels, custom levels support, active level filtering, and environment-based configuration.
const { Logger } = require('@reldens/utils');
// Standard logging
Logger.info('Application started');
Logger.error('Database connection failed', errorDetails);
Logger.debug('Processing user request', requestData);
// Custom levels
Logger.activeLogLevels = [3, 4, 10]; // Only critical, error, and custom level 10
Logger.customLevels = [10, 11, 12];
Logger.log(10, 'custom', 'Custom log message');
// Configuration
Logger.setForcedDisabled(false);
Logger.setAddTimeStamp(true);
Pagination helper that calculates page ranges for UI components, handling first/last page navigation and customizable display options.
const { PageRangeProvider } = require('@reldens/utils');
// Generate page range (it's a singleton, use directly)
let range = PageRangeProvider.fetch(5, 20, 7, 'First', 'Last');
// Returns: [{label: 'First', value: 1}, {label: 2, value: 2}, ...]
// Simple range
let simpleRange = PageRangeProvider.fetch(3, 10, 5);
// Returns pages around current page 3
Object validation utility that validates object properties against defined schemas with support for nested objects and custom validation rules.
const { SchemaValidator } = require('@reldens/utils');
let schema = {
username: { type: 'string', min: 3, max: 20 },
age: { type: 'int', min: 18 },
profile: {
type: 'object',
nested: {
email: { type: 'string', required: true }
}
}
};
let validator = new SchemaValidator(schema);
let userData = { username: 'player1', age: 25, profile: { email: 'test@example.com' } };
let isValid = validator.validate(userData);
Core utility class providing essential object manipulation, property access, and validation methods used throughout Reldens.
const { sc } = require('@reldens/utils');
// Safe property access
let value = sc.get(obj, 'nested.property.path', 'defaultValue');
// Check property ownership
if (sc.hasOwn(obj, 'propertyName')) {
// Property exists
}
// Type checking
sc.isObject(value); // true/false
sc.isArray(value); // true/false
sc.isFunction(value); // true/false
// Deep operations
let cloned = sc.deepClone(originalObject);
let merged = sc.deepMerge(obj1, obj2);
// Property manipulation
sc.getDef(obj, 'key', 'default'); // Get with default
sc.getOneDef(obj, ['key1', 'key2'], 'default'); // Get first found key
Singleton error handling utility with configurable tracing and custom error callbacks.
const { ErrorManager } = require('@reldens/utils');
// Enable stack traces
ErrorManager.enableTrace = true;
// Custom error handling
ErrorManager.callback = (message) => {
// Custom error handling logic
console.error('Custom error:', message);
// Return false to prevent default throw
return false;
};
// Trigger error
ErrorManager.error('Something went wrong');
Environment variable utilities with type conversion and validation for safe environment variable access.
const { EnvVar } = require('@reldens/utils');
// Get environment variables with type conversion
let port = EnvVar.integer(process.env, 'PORT', 3000); // Returns integer or default
let enabled = EnvVar.boolean(process.env, 'FEATURE_ENABLED', false); // Returns boolean
let apiUrl = EnvVar.string(process.env, 'API_URL', 'http://localhost'); // Returns string
// Other type helpers
let portNumber = EnvVar.port(process.env, 'PORT', 8080); // Validates port range 1-65535
let config = EnvVar.json(process.env, 'CONFIG', {}); // Parse JSON string
let items = EnvVar.array(process.env, 'ITEMS', [], ','); // Split string to array
let url = EnvVar.url(process.env, 'API_URL', 'http://localhost'); // Validate URL
Base interface for creating custom validators with a standard validate method.
const { ValidatorInterface } = require('@reldens/utils');
// Extend to create custom validators
class CustomValidator extends ValidatorInterface {
validate(data) {
// Custom validation logic
if (!data.requiredField) {
return false;
}
return true;
}
}
let validator = new CustomValidator();
let isValid = validator.validate({ requiredField: 'value' });
Need something specific?
Request a feature here: https://www.reldens.com/features-request
https://www.reldens.com/documentation/utils/
FAQs
Reldens - Utils
The npm package @reldens/utils receives a total of 42 weekly downloads. As such, @reldens/utils popularity was classified as not popular.
We found that @reldens/utils 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
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.