Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@tunnckocore/utils
Advanced tools
Utility functions and helpers for internal usage.
yarn add --dev @tunnckocore/utils
Useful for monorepo and non-monorepo setups, usually used for passing to module resolver options like the babel-plugin-module-resolver
and eslint-import-resolver-babel-module
.
If in monorepo setup, it will pick up the packages/
or whatever you defined on lerna.json
's packages
field, or the package.json
's yarn workspaces
field. If you don't have those defined, then it will return alias: {}
and the default extensions list.
const { createAliases, getWorkspacesAndExtensions } = require('@tunnckocore/utils');
const result = createAliases(process.cwd());
// => {
// cwd,
// alias: {},
// extensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs'],
// exts: ['js', 'jsx', 'ts', 'tsx', 'mjs'],
// }
If you have lerna.json
(or workspaces
field in your package.json
) with ['packages/*', '@tunnckocore/*']
then you can do the following
const { getWorkspacesAndExtensions } = require('@tunnckocore/utils');
console.log(getWorkspacesAndExtensions(process.cwd()));
// => {
// workspaces: ['packages', '@tunnckore'],
// extensions: ['.js', '.jsx', '.ts', '.tsx', '.mjs'],
// exts: ['js', 'jsx', 'ts', 'tsx', 'mjs'],
// }
If you want to support different extensions, pass extensions
field in your root package.json
.
Make sure you also have eslint-import-resolver-babel-module
installed.
For example, in your .eslintrc.js
file you can do the following
const proc = require('process');
const { createAliases } = require('@tunnckocore/utils');
const config = require('my-eslint-config');
module.exports = {
...config,
settings: {
...config.settings,
// by default we assuome your source code is in the package root's src/ dir
// if you have annother structure pass the name of your source directory.
'babel-module': createAliases(proc.cwd() /* , 'source' */),
},
};
FAQs
Utility functions and helpers for internal usage and monorepos
The npm package @tunnckocore/utils receives a total of 9 weekly downloads. As such, @tunnckocore/utils popularity was classified as not popular.
We found that @tunnckocore/utils 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.