Skip to content

Commit 2e9d421

Browse files
committed
docs update
1 parent 734ada0 commit 2e9d421

File tree

2 files changed

+102
-98
lines changed

2 files changed

+102
-98
lines changed

README.md

Lines changed: 60 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ ImageKit is a complete image optimization and transformation solution that comes
66

77
## Installation
88

9-
`npm install imagekit`
9+
Use the following command to download this module. Use the optional `--save` parameter if you wish to save the dependency in your `package.json` file.
10+
11+
```
12+
npm install imagekit
13+
```
1014

1115
## Initialization
1216

@@ -34,8 +38,8 @@ var imageURL = imagekit.url({
3438
path : "/default-image.jpg",
3539
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/endpoint/",
3640
transformation : [{
37-
"HEIGHT" : "300",
38-
"WIDTH" : "400"
41+
"height" : "300",
42+
"width" : "400"
3943
}]
4044
});
4145
```
@@ -55,8 +59,8 @@ This method allows you to add transformation parameters to an existing, complete
5559
var imageURL = imagekit.url({
5660
src : "https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg",
5761
transformation : [{
58-
"HEIGHT" : "300",
59-
"WIDTH" : "400"
62+
"height" : "300",
63+
"width" : "400"
6064
}]
6165
});
6266
```
@@ -89,10 +93,10 @@ var imageURL = imagekit.url({
8993
path : "/default-image.jpg",
9094
urlEndpoint : "https://ik.imagekit.io/your_imagekit_id/endpoint/",
9195
transformation : [{
92-
"HEIGHT" : "300",
93-
"WIDTH" : "400"
96+
"height" : "300",
97+
"width" : "400"
9498
}, {
95-
"ROTATION" : 90
99+
"rotation" : 90
96100
}],
97101
transformationPosition : "query"
98102
});
@@ -109,10 +113,10 @@ There are some transforms like [Sharpening](https://docs.imagekit.io/imagekit-do
109113
var imageURL = imagekit.url({
110114
src : "https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg",
111115
transformation : [{
112-
"FORMAT" : "jpg",
113-
"PROGRESSIVE" : "true",
114-
"EFFECT_SHARPEN" : "-",
115-
"EFFECT_CONTRAST" : "1"
116+
"format" : "jpg",
117+
"progressive" : "true",
118+
"effectSharpen" : "-",
119+
"effectContrast" : "1"
116120
}]
117121
});
118122
```
@@ -129,8 +133,8 @@ var imageURL = imagekit.url({
129133
"v" : "123"
130134
},
131135
transformation : [{
132-
"HEIGHT" : "300",
133-
"WIDTH" : "400"
136+
"height" : "300",
137+
"width" : "400"
134138
}],
135139
signed : true,
136140
expireSeconds : 300
@@ -146,48 +150,48 @@ The complete list of transformations supported and their usage in ImageKit can b
146150

147151
| Supported Transformation Name | Translates to parameter |
148152
|-------------------------------|-------------------------|
149-
| HEIGHT | h |
150-
| WIDTH | w |
151-
| ASPECT_RATIO | ar |
152-
| QUALITY | q |
153-
| CROP | c |
154-
| CROP_MODE | cm |
155-
| X | x |
156-
| Y | y |
157-
| FOCUS | fo |
158-
| FORMAT | f |
159-
| RADIUS | r |
160-
| BACKGROUND | bg |
161-
| BORDER | bo |
162-
| ROTATION | rt |
163-
| BLUR | bl |
164-
| NAMED | n |
165-
| OVERLAY_IMAGE | oi |
166-
| OVERLAY_X | ox |
167-
| OVERLAY_Y | oy |
168-
| OVERLAY_FOCUS | ofo |
169-
| OVERLAY_HEIGHT | oh |
170-
| OVERLAY_WIDTH | ow |
171-
| OVERLAY_TEXT | ot |
172-
| OVERLAY_TEXT_FONT_SIZE | ots |
173-
| OVERLAY_TEXT_FONT_FAMILY | otf |
174-
| OVERLAY_TEXT_COLOR | otc |
175-
| OVERLAY_ALPHA | oa |
176-
| OVERLAY_TEXT_TYPOGRAPHY | ott |
177-
| OVERLAY_BACKGROUND | obg |
178-
| OVERLAY_IMAGE_TRIM | oit |
179-
| PROGRESSIVE | pr |
180-
| LOSSLESS | lo |
181-
| TRIM | t |
182-
| METADATA | md |
183-
| COLOR_PROFILE | cp |
184-
| DEFAULT_IMAGE | di |
185-
| DPR | dpr |
186-
| EFFECT_SHARPEN | e-sharpen |
187-
| EFFECT_USM | e-usm |
188-
| EFFECT_CONTRAST | e-contrast |
189-
| EFFECT_GRAY | e-grayscale |
190-
| ORIGINAL | orig |
153+
| height | h |
154+
| width | w |
155+
| aspectRatio | ar |
156+
| quality | q |
157+
| crop | c |
158+
| cropMode | cm |
159+
| x | x |
160+
| y | y |
161+
| focus | fo |
162+
| format | f |
163+
| radius | r |
164+
| background | bg |
165+
| border | bo |
166+
| rotation | rt |
167+
| blur | bl |
168+
| named | n |
169+
| overlayImage | oi |
170+
| overlayX | ox |
171+
| overlayY | oy |
172+
| overlayFocus | ofo |
173+
| overlayHeight | oh |
174+
| overlayWidth | ow |
175+
| overlayText | ot |
176+
| overlayTextFontSize | ots |
177+
| overlayTextFontFamily | otf |
178+
| overlayTextColor | otc |
179+
| overlayAlpha | oa |
180+
| overlayTextTypography | ott |
181+
| overlayBackground | obg |
182+
| overlayImageTrim | oit |
183+
| progressive | pr |
184+
| lossless | lo |
185+
| trim | t |
186+
| metadata | md |
187+
| colorProfile | cp |
188+
| defaultImage | di |
189+
| dpr | dpr |
190+
| effectSharpen | e-sharpen |
191+
| effectUSM | e-usm |
192+
| effectContrast | e-contrast |
193+
| effectGray | e-grayscale |
194+
| original | orig |
191195

192196

193197

constants/supportedTransforms.js

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
11
module.exports = {
2-
"HEIGHT" : "h",
3-
"WIDTH" : "w",
4-
"ASPECT_RATIO" : "ar",
5-
"QUALITY" : "q",
6-
"CROP" : "c",
7-
"CROP_MODE" : "cm",
8-
"X" : "x",
9-
"Y" : "y",
10-
"FOCUS" : "fo",
11-
"FORMAT" : "f",
12-
"RADIUS" : "r",
13-
"BACKGROUND" : "bg",
14-
"BORDER" : "bo",
15-
"ROTATION" : "rt",
16-
"BLUR" : "bl",
17-
"NAMED" : "n",
18-
"OVERLAY_IMAGE" : "oi",
19-
"OVERLAY_X" : "ox",
20-
"OVERLAY_Y" : "oy",
21-
"OVERLAY_FOCUS" : "ofo",
22-
"OVERLAY_HEIGHT" : "oh",
23-
"OVERLAY_WIDTH" : "ow",
24-
"OVERLAY_TEXT" : "ot",
25-
"OVERLAY_TEXT_FONT_SIZE" : "ots",
26-
"OVERLAY_TEXT_FONT_FAMILY" : "otf",
27-
"OVERLAY_TEXT_COLOR" : "otc",
28-
"OVERLAY_ALPHA" : "oa",
29-
"OVERLAY_TEXT_TYPOGRAPHY" : "ott",
30-
"OVERLAY_BACKGROUND" : "obg",
31-
"OVERLAY_IMAGE_TRIM" : "oit",
32-
"PROGRESSIVE" : "pr",
33-
"LOSSLESS" : "lo",
34-
"TRIM" : "t",
35-
"METADATA" : "md",
36-
"COLOR_PROFILE" : "cp",
37-
"DEFAULT_IMAGE" : "di",
38-
"DPR" : "dpr",
39-
"EFFECT_SHARPEN" : "e-sharpen",
40-
"EFFECT_USM" : "e-usm",
41-
"EFFECT_CONTRAST" : "e-contrast",
42-
"EFFECT_GRAY" : "e-grayscale",
43-
"ORIGINAL" : "orig"
2+
"height" : "h",
3+
"width" : "w",
4+
"aspectRatio" : "ar",
5+
"quality" : "q",
6+
"crop" : "c",
7+
"cropMode" : "cm",
8+
"x" : "x",
9+
"y" : "y",
10+
"focus" : "fo",
11+
"format" : "f",
12+
"radius" : "r",
13+
"background" : "bg",
14+
"border" : "bo",
15+
"rotation" : "rt",
16+
"blur" : "bl",
17+
"named" : "n",
18+
"overlayImage" : "oi",
19+
"overlayX" : "ox",
20+
"overlayY" : "oy",
21+
"overlayFocus" : "ofo",
22+
"overlayHeight" : "oh",
23+
"overlayWidth" : "ow",
24+
"overlayText" : "ot",
25+
"overlayTextFontSize" : "ots",
26+
"overlayTextFontFamily" : "otf",
27+
"overlayTextColor" : "otc",
28+
"overlayAlpha" : "oa",
29+
"overlayTextTypography" : "ott",
30+
"overlayBackground" : "obg",
31+
"overlayImageTrim" : "oit",
32+
"progressive" : "pr",
33+
"lossless" : "lo",
34+
"trim" : "t",
35+
"metadata" : "md",
36+
"colorProfile" : "cp",
37+
"defaultImage" : "di",
38+
"dpr" : "dpr",
39+
"effectSharpen" : "e-sharpen",
40+
"effectUSM" : "e-usm",
41+
"effectContrast" : "e-contrast",
42+
"effectGray" : "e-grayscale",
43+
"original" : "orig"
4444
};

0 commit comments

Comments
 (0)