# @types/string-template

> TypeScript definitions for string-template

Latest version **1.0.7** (published 2025-07-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @types/string-template
pnpm add @types/string-template
yarn add @types/string-template
bun add @types/string-template
```

## Health

**Score 55/100 (C)** — status: stable.

Positive: has types; no vulnerabilities; high maintenance score; popular repo; extremely popular.

Warnings: low downloads; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2025-07-11 |
| First published | 2016-10-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51421 |
| Maintainers | types |

## Links

- npm: https://www.npmjs.com/package/@types/string-template
- Repository: https://github.com/DefinitelyTyped/DefinitelyTyped
- Homepage: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-template
- npm.io page: https://npm.io/package/@types/string-template

## Recent versions

- 1.0.7 (latest) — 2025-07-11
- 1.0.6 (ts4.5) — 2023-11-21
- 1.0.2 (ts3.2) — 2016-11-05
- 1.0.5 — 2023-11-07
- 1.0.4 — 2023-10-18
- 1.0.3 — 2023-09-25
- 1.0.1 — 2016-10-26

## README

# Installation
> `npm install --save @types/string-template`

# Summary
This package contains type definitions for string-template (https://www.npmjs.com/package/string-template).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-template.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-template/index.d.ts)
````ts
/**
 * NAMESPACE
 */
declare namespace StringTemplate {
    /**
     * Format
     */
    interface Format {
        // Format using an object hash with keys matching [0-9a-zA-Z]+
        (string: string, object: any): string;
        // Format using a number indexed array
        (string: string, array: any[]): string;
        // Format using optional arguments
        (string: string, ...array: any[]): string;
        // Escape {} pairs by using double {{}}
        (string: string): string;
    }

    /**
     * Compile
     */
    interface Compile {
        (string: string, inline?: boolean): Template;
    }

    interface Template {
        (object: any): string;
        (array: any[]): string;
        (...array: any[]): string;
    }
}

/**
 * MODULES
 */
declare module "string-template" {
    const format: StringTemplate.Format;
    export = format;
}

declare module "string-template/compile" {
    const compile: StringTemplate.Compile;
    export = compile;
}

````

### Additional Details
 * Last updated: Fri, 11 Jul 2025 23:02:22 GMT
 * Dependencies: none

# Credits
These definitions were written by [TonyYang](https://github.com/TonyPythoneer).

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