
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@debut/plugin-utils
Advanced tools
A set of indispensable utilities for the Debut ecosystem.
npm install @debut/plugin-utils --save
requireUncached(module: string)Allows the specified module to be connected without the standard Node caching. Instead of a native call to require(module: string)
getBotsSchema()Get the contents of schema.json file
getBotData(name: string, schema = getBotsSchema())Getting the bot's meta data by the name of the constructor.
getArgs<T>()Gets the arguments passed at startup. Returns an object key-value.
Example: node ./myscript.js --arg1=foo --arg2=bar.
import { cli } from '@debut/plugin-utils`;
const args = getArgs(); // { arg1: "foo", arg2: "bar" }
getTokens().Getting an object with private keys to work with the broker's API. From the file .tokens.json in the working directory of the project.
isSameDay(d1: Date, d2: Date)Are the two dates the same day
isWeekend(d: string | number | Date)Is the date the same day off
toIsoString(d: string | number | Date)Convert date to custom ISO format to work with tinkoff API.
getWeekDay(stamp: number)Get the day of the week in UTC time stamp
intervalToMs(interval: TimeFrame)Converting candlestick timeframe into a value in milliseconds
logDebug(...data: any[])Logging with event time information
saveFile(path: string, data: any)saveFile(path: string: data: any) ## Save the transferred data to the path pathensureFile(path: string)Checks if the path exists; if it does not, creates it
readFile(path: string)Safely reads a file
isDir(path: string)Is the path a directory
clamp(num: number, min: number, max: number)Clamping a number between a minimum and a maximum value
getPrecision(number: number | string)Getting the precision of a floating point number calculation
percentChange(current: number, prev: number)Percentage difference between two numbers
toFixed(num: number, precision = 2)A quick fix for the accuracy of a calculation, without losing type
getRandomArbitrary(min: number, max: number, odd?: boolean)Generation of a random number in the range [min, max] and optionally an odd number
getRandomInt(min: number, max: number, odd?: boolean)Generation of a random integer in the range [min, max], optionally odd
inverseType(type: OrderType)Inverts the type of a trade
syntheticOrderId(order: ExecutedOrder | OrderOptions)Synthetic random identifier for a trade
getMinIncrementValue(price: number | string)Minimum value in the accuracy of the passed number
getCurrencyProfit(order: ExecutedOrder, price: number)Counting the current profit in the currency of the trade
getCurrencyBatchProfit(orders: ExecutedOrder[], price: number)Counting current profit in the currency of the trade for several orders simultaneously
getCurrencyComissions(orders: ExecutedOrder[], price: number, fee: number)Counting current commision for single order based on predicatable fee number
getCurrencyBatchComissions(orders: ExecutedOrder[], price: number, fee: number)Counting current commision for several orders order based on predicatable fee number
sleep(ms: number)Initializes downtime for some time in milliseconds
FAQs
Debut utilites for core and plugins
The npm package @debut/plugin-utils receives a total of 18 weekly downloads. As such, @debut/plugin-utils popularity was classified as not popular.
We found that @debut/plugin-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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.