
Security News
/Research
Popular node-ipc npm Package Infected with Credential Stealer
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.
@ttoss/ids
Advanced tools
A library to handle the different ids used in the ttoss ecosystem applications
This package provides a opinionated way to work with different ids in the application.
Check the blog post for more information.
pnpm add @ttoss/ids
Example with PostgreSQL:
import { toRecordId, toGlobalId } from '@ttoss/ids';
const itemFromPostgreSQL = {
id: 1,
name: 'John Doe',
};
const recordId = toRecordId(itemFromPostgreSQL.id);
console.log(recordId); // 1
const globalId = toGlobalId('User', recordId);
console.log(globalId); // VXNlcjox
Example with DynamoDB:
import { toRecordId, toGlobalId } from '@ttoss/ids';
const itemFromDynamoDB = {
partitionKey: 'USER',
sortKey: '1',
name: 'John Doe',
};
const recordId = toRecordId([
itemFromDynamoDB.partitionKey,
itemFromDynamoDB.sortKey,
]);
console.log(recordId); // USER:1
const globalId = toGlobalId('User', recordId);
console.log(globalId); // VXNlcjpVU0VSOjE=
Example with PostgreSQL:
import { fromGlobalId, fromRecordId } from '@ttoss/ids';
const globalId = 'VXNlcjox';
const { type, recordId } = fromGlobalId(globalId);
console.log(type); // User
console.log(recordId); // 1
const [databaseId] = fromRecordId(recordId);
console.log(databaseId); // 1
Example with DynamoDB:
import { fromGlobalId, fromRecordId } from '@ttoss/ids';
const globalId = 'VXNlcjpVU0VSOjE=';
const { type, recordId } = fromGlobalId(globalId);
console.log(type); // User
console.log(recordId); // USER:1
const [partitionKey, sortKey] = fromRecordId(recordId);
console.log(partitionKey); // USER
console.log(sortKey); // 1
FAQs
A library to handle the different ids used in the ttoss ecosystem applications
We found that @ttoss/ids demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
Socket detected malicious node-ipc versions with obfuscated stealer/backdoor behavior in a developing npm supply chain attack.

Security News
TeamPCP and BreachForums are promoting a Shai-Hulud supply chain attack contest with a $1,000 prize for the biggest package compromise.

Security News
Packagist urges PHP projects to update Composer after a GitHub token format change exposed some GitHub Actions tokens in CI logs.