# @lucidcreative/disguise-asset

> a simple library for converting a filepath to a disguise asset object

Latest version **1.1.1** (published 2021-04-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @lucidcreative/disguise-asset
pnpm add @lucidcreative/disguise-asset
yarn add @lucidcreative/disguise-asset
bun add @lucidcreative/disguise-asset
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2021-04-11 |
| First published | 2019-04-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | KBjordahl |
| Maintainers | kylebjordahl, ezeki |
| Keywords | Lucid, disguise, d3, asset, version tag, asset management, sherlock |

## Links

- npm: https://www.npmjs.com/package/@lucidcreative/disguise-asset
- npm.io page: https://npm.io/package/@lucidcreative/disguise-asset

## Dependencies (4)

- [faker](https://npm.io/package/faker.md) ^4.1.0
- [luxon](https://npm.io/package/luxon.md) ^1.12.1
- [@types/faker](https://npm.io/package/@types/faker.md) ^4.1.5
- [@types/luxon](https://npm.io/package/@types/luxon.md) ^1.12.0

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2021-04-11
- 1.1.0 — 2019-04-24

## README

# disguise-asset

a simple library for converting a filepath to a disguise asset object. 

type-safety is included out of the box.

## Disguise asset object?
[Disguise](https://www.disguise.one) (aka d3) uses a set of content management rules to manage [version replacements](http://help.disguise.one/Content/Getting-started/Content-Management/Content-versioning.html) and other magic under the hood of their media server. This library attempts to recreate the logic they use to process a file based on it's file name and path. The resulting object looks like:

```typescript
interface DisguiseAsset {
	stem: string
	extension: string
	version?: string
	proxyLevel?: number
	frameStart?: number
	originalFilename: string
}
```

*you might notice that version is a string, when all other tags are numbers, and that's because date+letters is also a valid version tag. Versions are always sorted alphabetically.*

---

## Benchmark Summary:

|	Count	|	Time		|
|----------:|--------------:|
|       1 | 310112 μs        |
|     100 | 0.762929 ms   |
|    1000 | 6.511104 ms  |
| 1000000 | 171.870434 ms         |


* μs = nanoseconds
* test hardware: 
  * Darwin x64
  * Intel(R) Core(TM) i7-4980HQ CPU @ 2.80GHz
  * 16.0 GB RAM
* all tests done on randomized data, YMMV

---
brought to you by 

[![Lucid](https://ci4.googleusercontent.com/proxy/yKRk6C7KtirOW1ExpiKQ3Y6P9fJQbCB7sFJKunYjcnRhblTMK7bBOhVZ9-Bf-pYEIX0kob3-tZqUMGrjiKVV2T6hFiafBa9DAc3skqReyd9qkIetKilNt8O6xrboTBMIRRjriRmhwF_leR-Xfzxz_t_G5xbjjoLT6shZwilI54qECGyTueDLi-dpaWR-94Mp_3IdHh50LAeuJ5vy0A=s0-d-e1-ft#https://docs.google.com/uc?export=download&id=1MI_tkhEg2MOPiQvfWRwdWNRPltZPwB65&revid=0B_E6Q0L_NTYZZXhuaEMvK3hTZGZNMkk2MEdkWVQ3aEM5bkYwPQ "Lucid")](http://www.lucid.rocks)

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