# nxify

> Nxify allows you to modify your image urls based on the pixel ratio of the user's device.

Latest version **1.0.3** (published 2015-07-08) · MIT license · 0 weekly downloads

## Install

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

## 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.3 |
| Published | 2015-07-08 |
| First published | 2015-07-08 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | ruff |
| Maintainers | ruffle1986 |

## Links

- npm: https://www.npmjs.com/package/nxify
- Repository: https://github.com/purposeindustries/nxify
- Issues: https://github.com/purposeindustries/nxify/issues
- npm.io page: https://npm.io/package/nxify

## Recent versions

- 1.0.3 (latest) — 2015-07-08
- 1.0.2 — 2015-07-08
- 1.0.1 — 2015-07-08
- 1.0.0 — 2015-07-08

## README

# nxify

Nxify allows you to modify your image urls based on the pixel ratio of the user's device.

## Installation

```bash
$ npm install nxify
```

## Usage  

```js

var nxify = require('nxify');

var url = '/path/to/your/image.jpg';

if (window.devicePixelRatio > 1) {
  url = nxify(url);
}

console.log(url); // output: 'path/to/your/image@2x.jpg'

```

You can set your custom pixel ratio multiplier as the second parameter:

```js

var nxify = require('nxify');

var url = nxify('/path/to/your/image.png', 3);

console.log(url); // output: 'path/to/your/image@3x.png'

```

## Arguments

It waits for two parameters

- path (String)   path to the image you'd like to modify
- [pixelRatio=2]  the pixel ratio multiplier (default: 2)

## Tests

```bash
$ npm test
```

## License

  [MIT](LICENSE)

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