
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@hyrious/import-cost
Advanced tools
Get imported code size of a package.
This package is heavily inspired by import-cost.
> npx @hyrious/import-cost file.ts
Package Cost Where
lodash 70 kiB file.ts:2
import { importCost } from '@hyrious/import-cost'
const result = await importCost('file.ts', `
import { uniqueId } from 'lodash'
`)
// => { errors: [], warnings: [], packages: [
// { path: 'file.ts', name: 'lodash', line: 2, size: 70000, gzip: 70000 }
// ] }
path
{String} The path to the file, this is used for looking up the node_modules
folder.code
{String} The contents of the file.options
{Object}
lang
{String} Override the language infered from file extension. Available values: js
, ts
, jsx
, tsx
, vue
, svelte
.external
{String[]} Override packages to be excluded from the bundle. By default, all peer dependencies scanned from the package.json indicated by path
will be excluded.errors
, warnings
{Object[]} Passed through from esbuild.packages
{Object[]}
path
{String} The path to the file, same as the input argument.name
{String} The name of the analyzed package.line
{Number} The line number of the import statement.size
{Number} The size of the package in bytes.gzip
{Number} The size of the package in bytes after gzip.fail
{Boolean} true
if failed to bundle the package with esbuild.import { cache } from '@hyrious/import-cost'
cache.clear()
MIT @ hyrious
FAQs
Get package size of import statements, powered by esbuild
The npm package @hyrious/import-cost receives a total of 2 weekly downloads. As such, @hyrious/import-cost popularity was classified as not popular.
We found that @hyrious/import-cost 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
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.