@sitelintcode/optimize-image-on-the-client-side 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# Optimize image on the client side
|
|
2
2
|
|
|
3
|
-
Optimize image after selecting using `<input type="file">`.
|
|
3
|
+
Optimize image after selecting using `<input type="file">`. The optimization process takes place in the background and it's done automatically.
|
|
4
|
+
|
|
5
|
+
**Note that images that are larger in size after compression are not taken into account.**
|
|
4
6
|
|
|
5
7
|
## Demo
|
|
6
8
|
|
|
@@ -14,37 +16,20 @@ Optimize image after selecting using `<input type="file">`.
|
|
|
14
16
|
npm install @sitelintcode/optimize-image-on-the-client-side --save
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
### Browser environment
|
|
18
|
-
|
|
19
|
-
```Html
|
|
20
|
-
<script src="https://cdn.jsdelivr.net/npm/@sitelintcode/optimize-image-on-the-client-side@0.0.10/dist/optimize-image-on-the-client-side.js"></script>
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
#### Notes
|
|
24
|
-
|
|
25
|
-
See **0.0.10** version. Don't forget to set desired version. You may check releases: https://github.com/sitelint/optimize-image-on-the-client-side/releases
|
|
26
|
-
|
|
27
|
-
jsdelivr.com comment:
|
|
28
|
-
|
|
29
|
-
> // omit the version completely to get the latest one
|
|
30
|
-
// you should NOT use this in production
|
|
31
|
-
|
|
32
|
-
2. Usage:
|
|
33
|
-
|
|
34
19
|
## TypeScript
|
|
35
20
|
|
|
36
21
|
```TypeScript
|
|
37
|
-
|
|
22
|
+
import { OptimizeImage } from '@sitelintcode/optimize-image-on-the-client-side';
|
|
38
23
|
|
|
39
|
-
|
|
24
|
+
const optimizeImage: OptimizeImage = new OptimizeImage();
|
|
40
25
|
|
|
41
|
-
|
|
26
|
+
optimizeImage.install();
|
|
42
27
|
```
|
|
43
28
|
|
|
44
29
|
## Browser environment
|
|
45
30
|
|
|
46
31
|
```HTML
|
|
47
|
-
<script src="https://cdn.jsdelivr.net/npm/@sitelintcode/optimize-image-on-the-client-side@0.0.
|
|
32
|
+
<script src="https://cdn.jsdelivr.net/npm/@sitelintcode/optimize-image-on-the-client-side@0.0.13/dist/optimize-image-on-the-client-side.js"></script>
|
|
48
33
|
<script>
|
|
49
34
|
(function() {
|
|
50
35
|
const optimizeImage = new window.sitelint.OptimizeImage();
|
|
@@ -53,6 +38,15 @@ jsdelivr.com comment:
|
|
|
53
38
|
</script>
|
|
54
39
|
```
|
|
55
40
|
|
|
41
|
+
### Notes
|
|
42
|
+
|
|
43
|
+
See **0.0.13** version. Don't forget to set desired version. You may check releases: https://github.com/sitelint/optimize-image-on-the-client-side/releases
|
|
44
|
+
|
|
45
|
+
jsdelivr.com comment:
|
|
46
|
+
|
|
47
|
+
> // omit the version completely to get the latest one
|
|
48
|
+
// you should NOT use this in production
|
|
49
|
+
|
|
56
50
|
## Technical
|
|
57
51
|
|
|
58
52
|
1. `import { terser } from "rollup-plugin-terser";` was replaced with `import { terser } from "rollup-plugin-minification";` because `rollup-plugin-terser` is not compatible with Rollup 3.x version. See: https://github.com/TrySound/rollup-plugin-terser/issues/119
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@sitelintcode/optimize-image-on-the-client-side",
|
|
3
3
|
"description": "Optimize image on the client side",
|
|
4
4
|
"author": "Cezary Tomczyk <cezary.tomczyk@gmail.com> (https://www.sitelint.com/)",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.14",
|
|
6
6
|
"license": "MOZILLA PUBLIC LICENSE, VERSION 2.0",
|
|
7
7
|
"node": ">=16",
|
|
8
8
|
"main": "dist/optimize-image-on-the-client-side.js",
|