# @types/rename

> TypeScript definitions for rename

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

## Install

```sh
npm install @types/rename
pnpm add @types/rename
yarn add @types/rename
bun add @types/rename
```

## Health

**Score 45/100 (D)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-11-07 |
| First published | 2018-04-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 51445 |
| Maintainers | types |

## Links

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

## Recent versions

- 1.0.7 (latest) — 2023-11-07
- 1.0.4 (ts3.6) — 2021-07-08
- 1.0.3 (ts3.5) — 2021-05-13
- 1.0.2 (ts3.1) — 2020-08-23
- 1.0.1 (ts2.5) — 2018-04-12
- 1.0.6 — 2023-10-18
- 1.0.5 — 2023-09-27
- 1.0.0 — 2018-04-11

## README

# Installation
> `npm install --save @types/rename`

# Summary
This package contains type definitions for rename (https://github.com/popomore/rename).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rename.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/rename/index.d.ts)
````ts
export = rename;

declare function rename(filepath: string | rename.FileObject, transformer: rename.Transformer): rename.FilePath;

declare namespace rename {
    interface FileObject {
        // using package's terminology
        dirname?: string | undefined;
        basename?: string | undefined;
        extname?: string | undefined;
        path?: string | undefined;
        hash?: string | undefined; // not populated by package
        origin?: string | undefined;
    }

    interface Specification {
        dirname?: string | undefined;
        prefix?: string | undefined;
        basename?: string | undefined;
        suffix?: string | undefined;
        extname?: string | undefined;
    }

    type FilePath =
        | string
        | Specification;

    type Transformer =
        | ((spec: FileObject) => FilePath)
        | FilePath;

    interface ParsedFileObject {
        dirname: string;
        extname: string;
        basename: string;
        origin: string;
    }

    function parse(filename: string | Partial<ParsedFileObject>): ParsedFileObject;

    function stringify(obj: FileObject): string;
}

````

### Additional Details
 * Last updated: Tue, 07 Nov 2023 15:11:36 GMT
 * Dependencies: none

# Credits
These definitions were written by [Aankhen](https://github.com/Aankhen).

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