Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed May 10, 2020
1 parent c8caaa3 commit f71d2f8
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: node_js
node_js:
- '14'
- '12'
- '10'
- '8'
28 changes: 13 additions & 15 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ declare const terminalImage: {
})();
```
*/
buffer(imageBuffer: Buffer, options?: {
width?: number,
height?: number,
preserveAspectRatio?: boolean
}): Promise<string>;
buffer: (imageBuffer: Readonly<Buffer>, options?: Readonly<{
width?: number;
height?: number;
preserveAspectRatio?: boolean;
}>) => Promise<string>;

/**
Display images in the terminal. Please note that the image will always be scaled to fit the size of the terminal.
Expand All @@ -57,8 +57,6 @@ declare const terminalImage: {
@param options.preserveAspectRatio - Optional: Whether to maintain image aspect ratio or not. Default: true.
@returns The ANSI escape codes to display the image.
@example
```
const terminalImage = require('terminal-image');
Expand All @@ -71,14 +69,14 @@ declare const terminalImage: {
})();
```
*/
file(
file: (
filePath: string,
options?: {
width?: number,
height?: number,
preserveAspectRatio?: boolean
}
): Promise<string>;
}
options?: Readonly<{
width?: number;
height?: number;
preserveAspectRatio?: boolean;
}>
) => Promise<string>;
};

export = terminalImage;
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ async function render(buffer, {width: inputWidth, height: inputHeight, preserveA
return result;
}

exports.buffer = async (buffer, {height, width, preserveAspectRatio = true} = {}) => {
exports.buffer = async (buffer, {width = '100%', height = '100%', preserveAspectRatio = true} = {}) => {
return termImg.string(buffer, {
width: width || '100%',
height: height || '100%',
width,
height,
fallback: () => render(buffer, {height, width, preserveAspectRatio})
});
};
Expand Down
2 changes: 1 addition & 1 deletion license
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
"description": "Display images in the terminal",
"license": "MIT",
"repository": "sindresorhus/terminal-image",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
Expand Down Expand Up @@ -41,13 +42,13 @@
],
"dependencies": {
"@sindresorhus/jimp": "^0.3.0",
"chalk": "^2.4.2",
"chalk": "^4.0.0",
"term-img": "^4.1.0"
},
"devDependencies": {
"@types/node": "^11.13.8",
"@types/node": "^13.13.5",
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
"tsd": "^0.11.0",
"xo": "^0.30.0"
}
}
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# terminal-image [![Build Status](https://travis-ci.org/sindresorhus/terminal-image.svg?branch=master)](https://travis-ci.org/sindresorhus/terminal-image)
# terminal-image [![Build Status](https://travis-ci.com/sindresorhus/terminal-image.svg?branch=master)](https://travis-ci.com/sindresorhus/terminal-image)

> Display images in the terminal
Expand Down

0 comments on commit f71d2f8

Please # to comment.