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.
skuba-dive
Advanced tools
Minimal runtime for skuba
.
TypeScript assertion functions for narrowing down types in unit tests and the like.
These may be used for input validation in your application code at a pinch, but consider a proper validation library with richer error handling and reporting.
import { Assert } from 'skuba-dive';
it('should think of a good test case name', () => {
const result = numberOrNull();
// result is number | null
Assert.notNullish(result);
// result is number
});
Functions for reading values out of environment variables.
For example, in your /src/config.ts
:
import { Env } from 'skuba-dive';
const ENVIRONMENTS = ['dev', 'prod'] as const;
export type Environment = typeof ENVIRONMENTS[number];
export const environment = Env.oneOf(ENVIRONMENTS)('ENVIRONMENT');
// 'dev' | 'prod'
export const port = Env.nonNegativeInteger('PORT', { default: undefined });
// number | undefined
export const version = Env.string('VERSION', { default: 'local' });
// string | 'local'
export const flag = Env.boolean('FLAG');
// boolean
Each function will throw if its environment variable is not set and opts.default
is not provided.
Runtime hook for import paths relative to /src
.
Make a side-effectful import at the top of your entry point(s):
// /src/register.ts
import 'skuba-dive/register';
// /src/app.ts
import './register';
import { config } from 'src/config';
export = new Koa();
The hook must be imported from a module that sits directly under /src
for module resolution to work correctly.
skuba-dive
packages up:
skuba
FAQs
Minimal runtime for skuba
The npm package skuba-dive receives a total of 4,064 weekly downloads. As such, skuba-dive popularity was classified as popular.
We found that skuba-dive 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.