# truncateFilename

> truncateFilenames a JavaScript string

Latest version **0.1.0** (published 2016-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install truncateFilename
pnpm add truncateFilename
yarn add truncateFilename
bun add truncateFilename
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2016-07-13 |
| First published | 2016-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.8.x |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Stefan Backor |
| Maintainers | pista329 |
| Keywords | truncateFilename, smart truncateFilename, truncateFilename string, truncateFilename filename, string |

## Links

- npm: https://www.npmjs.com/package/truncateFilename
- Repository: https://github.com/pista329/truncateFilename
- Homepage: http://backor.sk
- Issues: https://github.com/pista329/truncateFilename/issues
- npm.io page: https://npm.io/package/truncateFilename

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2016-07-13

## README

# truncateFilename [![Build Status](https://travis-ci.org/pista329/truncateFilename.png?branch=master)](https://travis-ci.org/pista329/truncateFilename) [![npm version](https://badge.fury.io/js/truncateFilename.png)](https://npmjs.org/package/truncateFilename) [![devDependency Status](https://david-dm.org/pista329/truncateFilename/dev-status.png)](https://david-dm.org/pista329/truncateFilename#info=devDependencies)

Truncates a filename string preserving filename extension.

### Install with npm

```
npm install truncateFilename
```

To then include truncateFilename in your node app:

```
var truncateFilename = require("truncateFilename");
```

### Using truncateFilename

```js
var result = truncateFilename("helloWorld.minified.js", 15, "...");
```

### Example

```js
var original = "helloWorld.minified.js";

truncateFilename(original, 15, "...");
// "hello...fied.js"
```

## License

[MIT License](http://ilee.mit-license.org)

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