Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@types/bytes
Advanced tools
TypeScript definitions for bytes
npm install --save @types/bytes
This package contains type definitions for bytes (https://github.com/visionmedia/bytes.js).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bytes.
/**
* Convert the given value in bytes into a string.
*/
declare function bytes(value: number, options?: bytes.BytesOptions): string;
/**
* Parse string to an integer in bytes.
*/
declare function bytes(value: string): number;
declare namespace bytes {
type Unit = "b" | "gb" | "kb" | "mb" | "pb" | "tb" | "B" | "GB" | "KB" | "MB" | "PB" | "TB";
interface BytesOptions {
decimalPlaces?: number | undefined;
fixedDecimals?: boolean | undefined;
thousandsSeparator?: string | undefined;
unit?: Unit | undefined;
unitSeparator?: string | undefined;
}
/**
* Format the given value in bytes into a string.
*
* If the value is negative, it is kept as such.
* If it is a float, it is rounded.
*/
function format(value: number, options?: BytesOptions): string;
/**
* Parse the string value into an integer in bytes.
*
* If no unit is given, it is assumed the value is in bytes.
*/
function parse(value: string | number): number;
}
export = bytes;
These definitions were written by Zhiyuan Wang, Rickard Laurin, and Florian Keller.
FAQs
TypeScript definitions for bytes
The npm package @types/bytes receives a total of 162,609 weekly downloads. As such, @types/bytes popularity was classified as popular.
We found that @types/bytes 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
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.