
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
@hon2a/less-vars-to-js
Advanced tools
Parse a less variable list and its dependencies and return a map of all resolved variables
Parse a less variable list and its dependencies and return a map of all resolved variables
Install using
npm install @hon2a/less-vars-to-js
Use to load file and all its imports, resolve all variables, and collect them. E.g. the following setup:
<CWD>/node_modules/some-lib/dist/vars.less
@primary-color: green;
@error-color: brickred;
src/style/theme.less
@import '~some-lib/dist/vars';
@primary-color: blue;
src/style/variables.less
@import './theme';
@secondary-color: darken(@primary-color, 10);
@match-rate-low-color: @error-color;
yields the following extraction:
import { loadAndResolveLessVars } from '@hon2a/less-vars-to-js'
const theme = await loadAndResolveLessVars('./src/style/variables.less')
/* {
* 'primary-color': 'blue',
* 'error-color': 'brickred',
* 'secondary-color': '#0000cc',
* 'match-rate-color': 'brickred'
* }
*/
Note: If you're using external imports (e.g. import '~someLib/path/to/styles.less';
), this
needs to run in the root folder of your package, so that it finds the libs at ./node_modules
.
Pass Less parser options as a second argument to loadAndResolveLessVars
if you need to customize them.
Install dependencies using:
npm install
After you modify sources, run the following (or set up your IDE to do it for you):
npm run format
npm run lint
npm test
and fix the errors, if there are any.
Publishing is done in two steps:
npm version <patch|minor|major>
git push --follow-tags
npm publish --access public
FAQs
Parse a less variable list and its dependencies and return a map of all resolved variables
The npm package @hon2a/less-vars-to-js receives a total of 45 weekly downloads. As such, @hon2a/less-vars-to-js popularity was classified as not popular.
We found that @hon2a/less-vars-to-js 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.