{"name":"term-img","version":"7.0.0","keywords":["term","image","iterm","iterm2","terminal","shell","console","command-line","img","pic","picture","photo","app","version","ansi","escape","gif","gifs","jpg","jpeg"],"author":{"url":"https://sindresorhus.com","name":"Sindre Sorhus","email":"sindresorhus@gmail.com"},"license":"MIT","_id":"term-img@7.0.0","maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"homepage":"https://github.com/sindresorhus/term-img#readme","bugs":{"url":"https://github.com/sindresorhus/term-img/issues"},"dist":{"shasum":"641d297f1b5f8e161ea7565df69a4e7dee2a6897","tarball":"http://registry-npm.ywwl.com/term-img/download/term-img-7.0.0.tgz","fileCount":5,"integrity":"sha512-uG+2G+WVElamsxKAy3h8sug6ut3MFa7gdYXc3LpCIKKlCPTBZq5KulU+618I47TnMvm3vyVkfQO+6yVunBZoRQ==","signatures":[{"sig":"MEQCID5AnKyqqJw73xmfaz9NCBfv+Fg/w8oIa5BD19Qfq6RuAiA7taCfyI3+GxKMZ+ZTTk9mLCd84yaMckuAFz6RIXlf3g==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":5394,"size":2561,"noattachment":false,"key":"/term-img/-/term-img-7.0.0.tgz"},"type":"module","types":"./index.d.ts","engines":{"node":">=18"},"exports":{"types":"./index.d.ts","default":"./index.js"},"funding":"https://github.com/sponsors/sindresorhus","gitHead":"6431c28fd7e8bee04d14cf5df62662d747f29e7b","scripts":{"test":"xo && ava && tsd"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/term-img.git","type":"git"},"_npmVersion":"10.6.0","description":"Display images in iTerm","directories":{},"sideEffects":false,"_nodeVersion":"18.20.2","dependencies":{"ansi-escapes":"^7.0.0","iterm2-version":"^5.0.0"},"_hasShrinkwrap":false,"devDependencies":{"xo":"^0.59.2","ava":"^6.1.3","tsd":"^0.31.1","@types/node":"^20.14.12"},"_npmOperationalInternal":{"tmp":"tmp/term-img_7.0.0_1721997890991_0.7541890057672271","host":"s3://npm-registry-packages"},"readme":"# term-img\n\n> Display images in terminals using the iTerm inline image protocol\n\nYou probably want the higher-level [`terminal-image`](https://github.com/sindresorhus/terminal-image) package for displaying your images.\n\n![](screenshot.jpg)\n\nEven [animated gifs](https://github.com/vdemedes/gifi)!\n\n*Currently only supported on [iTerm >=3](https://www.iterm2.com/downloads.html), [WezTerm](https://wezfurlong.org/wezterm/), [Konsole](https://konsole.kde.org/), [Rio](https://rioterm.com/), and [VSCode integrated terminal](https://code.visualstudio.com/).*\n\n## Install\n\n```sh\nnpm install term-img\n```\n\n## Usage\n\n```js\nimport terminalImage from 'term-img';\n\nfunction fallback() {\n\t// Return something else when not supported\n}\n\nconsole.log(terminalImage('unicorn.jpg', {fallback}));\n```\n\n## API\n\n### terminalImage(image, options?)\n\nGet the image as a `string` that you can log manually.\n\n#### image\n\nType: `string | Uint8Array`\n\nFile path to an image or an image as a buffer.\n\n#### options\n\nType: `object`\n\n##### width\n##### height\n\nType: `'auto' | string | number`\n\nThe width and height are given as a number followed by a unit, or the word `'auto'`.\n\n- `N`: N character cells.\n- `Npx`: N pixels.\n- `N%`: N percent of the session's width or height.\n- `auto`: The image's inherent size will be used to determine an appropriate dimension.\n\n##### preserveAspectRatio\n\nType: `boolean`\\\nDefault: `true`\n\n##### fallback\n\nType: `Function`\\\nDefault: `() => throw new UnsupportedTerminalError()`\n\nEnables you to do something else when the terminal doesn't support images.\n\n## Related\n\n- [term-img-cli](https://github.com/sindresorhus/term-img-cli) - CLI for this module\n- [term-kitty-img](https://github.com/tbjgolden/term-kitty-img) - Similar package but for Kitty, Konsole, WezTerm\n","publish_time":1721997891205,"_cnpm_publish_time":1721997891205,"dist-tags":{"latest":"7.1.0"}}