
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.
@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')
/* {
* primaryColor: 'blue',
* errorColor: 'brickred',
* secondaryColor: '#0000cc',
* matchRateLowColor: '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 67 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
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.