# @segment/fmt

> util.format-like string formatting utility

Latest version **1.0.0** (published 2016-05-20) · SEE LICENSE IN LICENSE license · 0 weekly downloads

## Install

```sh
npm install @segment/fmt
pnpm add @segment/fmt
yarn add @segment/fmt
bun add @segment/fmt
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2016-05-20 |
| First published | 2016-05-20 |
| Weekly downloads | 0 |
| License | SEE LICENSE IN LICENSE |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Segment |
| Maintainers | segment |
| Keywords | util, format, util-format, fmt |

## Links

- npm: https://www.npmjs.com/package/@segment/fmt
- Repository: https://github.com/segmentio/fmt
- Homepage: https://github.com/segmentio/fmt#readme
- Issues: https://github.com/segmentio/fmt/issues
- npm.io page: https://npm.io/package/@segment/fmt

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2016-05-20

## README

# fmt

[![CircleCI](https://circleci.com/gh/segmentio/fmt.svg?style=shield&circle-token=a8e3741191a19d98b7d5796fd9bfc1b544d18a25)](https://circleci.com/gh/segmentio/fmt)
[![Codecov](https://img.shields.io/codecov/c/github/segmentio/fmt/master.svg?maxAge=2592000)](https://codecov.io/gh/segmentio/fmt)

`util.format`-like string format utility.

## Installation

```sh
$ npm install @segment/fmt
```

## Example

```js
fmt('%d %s %o', '0n', 'str', {});
// => "0 str {}"

fmt.f = function(n){
  return Number(n || 0).toFixed(2);
};

fmt('floats: %f', 1);
// => "floats: 1.00"
```

## API

### fmt(str, ...)

Format the given `str` with `...` args.

```js
`%o`: JSON.stringify
`%d`: parseInt
`%s`: String
```

---
_Source: https://npm.io/package/@segment/fmt · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
