{"name":"term-img","version":"7.1.0","description":"Display images in terminals using the iTerm inline image protocol","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/term-img.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"types":"./index.d.ts","default":"./index.js"},"sideEffects":false,"engines":{"node":">=18"},"scripts":{"test":"xo && ava && tsd"},"keywords":["term","image","iterm","iterm2","terminal","shell","console","command-line","img","pic","picture","photo","app","version","ansi","escape","gif","gifs","jpg","jpeg"],"dependencies":{"ansi-escapes":"^7.1.1","iterm2-version":"^5.0.0"},"devDependencies":{"@types/node":"^20.14.12","ava":"^6.1.3","tsd":"^0.31.1","xo":"^0.59.2"},"gitHead":"c495c81578c1391fa0f753644a0d1e631f23a177","types":"./index.d.ts","_id":"term-img@7.1.0","bugs":{"url":"https://github.com/sindresorhus/term-img/issues"},"homepage":"https://github.com/sindresorhus/term-img#readme","_nodeVersion":"20.19.5","_npmVersion":"11.6.1","dist":{"integrity":"sha512-au++khgSDly2KXNhC6BOU3mLi2v+Dk5mChYKDcpB5xYwhlwqYQtj0z59dIqFEmr+w7ndZaNqurHapkGc6/hprQ==","shasum":"d15891ffd6360a29b68b4bbce6e72081c0fc9530","tarball":"http://registry-npm.ywwl.com/term-img/download/term-img-7.1.0.tgz","fileCount":5,"unpackedSize":7613,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBVe2OGPj9paIgRjC5zERg6lsr4X10GprhuU1YMxKfOkAiBCw/Zf4abau2KxpDiUmeZcXotdL5rXLRaDXSiX0pG+Yg=="}],"size":3191,"noattachment":false,"key":"/term-img/-/term-img-7.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":"sindresorhus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/term-img_7.1.0_1759810954157_0.032529909432958526"},"_hasShrinkwrap":false,"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":1759810954346,"_cnpm_publish_time":1759810954346,"dist-tags":{"latest":"7.1.0"}}