-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8164af6
Showing
29 changed files
with
7,115 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
{ | ||
"env": { | ||
"node": true, | ||
"es6": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"airbnb-base" | ||
], | ||
"overrides": [ | ||
{ | ||
"files": [ | ||
"*.ts", | ||
"*.tsx" | ||
], | ||
"extends": [ | ||
"airbnb-base", | ||
"airbnb-typescript/base" | ||
], | ||
"parserOptions": { | ||
"project": [ | ||
"./tsconfig.json" | ||
] | ||
}, | ||
"rules": { | ||
"@typescript-eslint/no-empty-function": "off", | ||
"@typescript-eslint/no-shadow": "off", | ||
"import/prefer-default-export": "off", | ||
"class-methods-use-this": "off", | ||
"no-underscore-dangle": "off", | ||
"no-param-reassign": "off" | ||
} | ||
} | ||
], | ||
"rules": { | ||
"import/no-extraneous-dependencies": [ | ||
"error", | ||
{ | ||
"devDependencies": true | ||
} | ||
], | ||
"no-console": "off", | ||
"import/no-unresolved": "off", | ||
"import/prefer-default-export": "off", | ||
"max-len": "off", | ||
"no-shadow": "off", | ||
"no-param-reassign": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.idea | ||
.DS_Store | ||
node_modules | ||
dist |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# История версий | ||
|
||
Все заметные изменения задокументированы в этом файле. | ||
|
||
[1.0.0]: https://github.com/digikid/tiny-compressor/releases/tag/1.0.0 | ||
|
||
## [1.0.0] - 2022-07-04 | ||
|
||
Первый публичный релиз |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2022 Alexander Dovlatov | ||
|
||
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: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
<div align="center"> | ||
<img alt="TinyCompressor" src="https://github.com/digikid/tiny-compressor/raw/main/logo.png" height="117" /> | ||
</div> | ||
|
||
<div align="center"> | ||
<h1>TinyCompressor</h1> | ||
<p>Компрессор JPG, PNG и WebP изображений, использующий TinyPNG API.<br><b>Не требует использования API ключа.</b></p> | ||
<img src="https://img.shields.io/github/release/digikid/tiny-compressor.svg?style=flat-square&logo=appveyor" alt="Release version"> | ||
<img src="https://img.shields.io/github/languages/top/digikid/tiny-compressor.svg?style=flat-square&logo=appveyor" alt="TypeScript"> | ||
<img src="https://img.shields.io/github/license/digikid/tiny-compressor.svg?style=flat-square&logo=appveyor" alt="MIT License"> | ||
<br> | ||
<br> | ||
</div> | ||
|
||
## Преимущества | ||
|
||
- В отличие от других компрессоров позволяет добиваться до 80% сжатия без ощутимой потери качества | ||
- За счет кеширования снижается количество обращений к серверу и обрабатываются только изменившиеся файлы | ||
- Написан на TypeScript | ||
|
||
## Установка | ||
|
||
```shell | ||
npm i digikid/tiny-compressor | ||
``` | ||
|
||
## Запуск | ||
|
||
Перейдите в директорию с изображениями и запустите команду: | ||
|
||
```shell | ||
tiny-compressor | ||
``` | ||
|
||
После этого обработанные изображения будут сохранены в папку `/compressed` с учетом вложенности. | ||
|
||
## Настройка | ||
|
||
### Список параметров | ||
|
||
| Параметр | Описание | | ||
|---------------------|--------------------------------------------------| | ||
| <b>-c, --config</b> | Изменить настройки по умолчанию | | ||
| <b>-f, --force</b> | Обработать все файлы без учета кеша | | ||
| <b>-h, --help</b> | Показать раздел справки | | ||
| <b>-p, --path</b> | Название директории для обработанных изображений | | ||
| <b>-q, --quiet</b> | Отключить уведомления | | ||
| <b>-r, --reset</b> | Очистить кеш | | ||
| <b>-s, --stat</b> | Показать историю изменения файлов | | ||
| <b>-w, --watch</b> | Запустить слежение за изменением файлов | | ||
|
||
### Кеширование | ||
|
||
Для исключения повторной компрессии файлов и уменьшения количества запросов к серверу TinyPNG, все обработанные файлы по умолчанию попадают в кеш. | ||
|
||
Если вы хотите запустить компрессию, игнорируя кэш, передайте флаг `-f`: | ||
|
||
```shell | ||
tiny-compressor -f | ||
``` | ||
|
||
Для очистки кеша воспользуйтесь командой: | ||
|
||
```shell | ||
tiny-compressor -r | ||
``` | ||
|
||
### Название папки | ||
|
||
Изменить название для папки с обработанными изображениями (без сохранения в настройках) можно командой: | ||
|
||
```shell | ||
tiny-compressor -p compressed-images | ||
``` | ||
|
||
### Изменение настроек | ||
|
||
Настройки сохраняются локально и применяются при всех последующих запусках. | ||
|
||
Чтобы изменить их, запустите компрессор с параметром `-c`: | ||
|
||
```shell | ||
tiny-compressor -c | ||
``` | ||
|
||
### Показ уведомлений | ||
|
||
По умолчанию при каждой обработке файлов генерируются уведомления, которые можно отключить через флаг `-q`: | ||
|
||
```shell | ||
tiny-compressor -q | ||
``` | ||
|
||
### История изменения файлов | ||
|
||
Для просмотра истории изменения файлов (кеша) используйте флаг `-s`: | ||
|
||
```shell | ||
tiny-compressor -s | ||
``` | ||
|
||
### Слежение за файлами | ||
|
||
Для запуска компрессии при каждом изменении файлов в текущей папке передайте параметр `-w`: | ||
|
||
```shell | ||
tiny-compressor -w | ||
``` | ||
|
||
## Лицензия | ||
|
||
[The MIT License (MIT)](LICENSE) |
Oops, something went wrong.