
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.
@programsmagic/toon-tokenizer
Advanced tools
Token counting and estimation utilities for multiple LLM models
Token counting and estimation utilities for multiple LLM models.
npm install @toon/tokenizer
# or
pnpm add @toon/tokenizer
# or
yarn add @toon/tokenizer
import { countTokensInText } from '@toon/tokenizer';
const result = countTokensInText('Hello, world!', 'gpt-4');
console.log(result.tokens); // Token count
console.log(result.estimatedCost); // Estimated cost
import { createTokenEstimator } from '@toon/tokenizer';
const estimator = createTokenEstimator('gpt-4', 300);
const result = await estimator('Your text here');
import { analyzeTokensPerField } from '@toon/tokenizer';
const data = { user: { id: 123, name: 'Ada' } };
const analysis = analyzeTokensPerField(data, 'gpt-4');
console.log(analysis.topFields); // Top N most expensive fields
import { auditFile } from '@toon/tokenizer';
const result = await auditFile('data.json', 'gpt-4');
console.log(result.potentialSavings); // Potential savings with TOON
countTokensInText(text, model?)Count tokens in text string.
countTokensInData(data, model?)Count tokens in JSON data structure.
createTokenEstimator(model?, debounceMs?)Create debounced token estimator for real-time updates.
analyzeTokensPerField(data, model?, topN?)Analyze tokens per field in data structure.
auditFile(filePath, model?)Audit token usage in a file.
MIT
FAQs
Token counting and estimation utilities for multiple LLM models
We found that @programsmagic/toon-tokenizer 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.