Skip to content

Commit e86ac98

Browse files
committed
README updated
1 parent 913f426 commit e86ac98

File tree

1 file changed

+220
-8
lines changed

1 file changed

+220
-8
lines changed

README.md

Lines changed: 220 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@ See the complete list of transformations supported in ImageKit [here](https://do
176176
| height | h |
177177
| width | w |
178178
| aspectRatio | ar |
179+
| padResizeCrop | cm-pad_resize |
180+
| forcedCrop | c-force |
181+
| maxSizeCrop | c-at_max |
182+
| minSizeCrop | c-at_least |
183+
| maintainRatioCrop | c-maintain_ratio |
184+
| extractCrop | cm-extract |
185+
| padExtractCrop | cm-pad_extract |
186+
| autoSmartCrop | fo-auto |
187+
| faceCrop | fo-face |
188+
| focusCustom | fo-custom |
189+
| xc | xc |
190+
| yc | yc |
179191
| quality | q |
180192
| crop | c |
181193
| cropMode | cm |
@@ -217,6 +229,21 @@ See the complete list of transformations supported in ImageKit [here](https://do
217229
| overlayTextPadding | otp |
218230
| overlayTextInnerAlignment | otia |
219231
| overlayRadius | or |
232+
| overlayMinSizeCrop | oic-at_least |
233+
| overlayMaxSizeCrop | oic-at_max |
234+
| overlayForcedCrop | oic-force |
235+
| overlayMaintainRatioCrop | oic-maintain_ratio |
236+
| overlayExtractCrop | oicm-extract |
237+
| overlayPadExtractCrop | oicm-pad_extract |
238+
| overlayPadResizeCrop | oicm-pad_resize |
239+
| overlayFocusCrop | oifo |
240+
| overlayAutoSmartCrop | oifo-auto |
241+
| overlayFocusCustom | oifo-custom |
242+
| overlayFaceCrop | oifo-face |
243+
| oixc | oixc |
244+
| oiyc | oiyc |
245+
| oix | oix |
246+
| oiy | oiy |
220247
| progressive | pr |
221248
| lossless | lo |
222249
| trim | t |
@@ -388,8 +415,7 @@ imagekit.deleteFile("file_id", function(error, result) {
388415

389416
// Using Promises
390417

391-
imagekit.deleteFile("file_id")
392-
}).then(response => {
418+
imagekit.deleteFile("file_id").then(response => {
393419
console.log(response);
394420
}).catch(error => {
395421
console.log(error);
@@ -411,8 +437,7 @@ imagekit.bulkDeleteFiles(["fileIds"], function(error, result) {
411437

412438
// Using Promises
413439

414-
imagekit.bulkDeleteFiles(["fileIds"])
415-
}).then(response => {
440+
imagekit.bulkDeleteFiles(["fileIds"]).then(response => {
416441
console.log(response);
417442
}).catch(error => {
418443
console.log(error);
@@ -434,8 +459,7 @@ imagekit.purgeCache("full_url", function(error, result) {
434459

435460
// Using Promises
436461

437-
imagekit.purgeCache("full_url")
438-
}).then(response => {
462+
imagekit.purgeCache("full_url").then(response => {
439463
console.log(response);
440464
}).catch(error => {
441465
console.log(error);
@@ -457,8 +481,196 @@ imagekit.getPurgeCacheStatus("cache_request_id", function(error, result) {
457481

458482
// Using Promises
459483

460-
imagekit.getPurgeCacheStatus("cache_request_id")
461-
}).then(response => {
484+
imagekit.getPurgeCacheStatus("cache_request_id").then(response => {
485+
console.log(response);
486+
}).catch(error => {
487+
console.log(error);
488+
});
489+
```
490+
491+
**9. Bulk Add tags**
492+
493+
Add tags to multiple files in a single request as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/add-tags-bulk). The method accepts an array of fileIDs of the files and an array of tags that have to be added to those files.
494+
495+
```js
496+
// Using Callback Function
497+
498+
imagekit.bulkAddTags(["fileIds"], ["tags"], function(error, result) {
499+
if(error) console.log(error);
500+
else console.log(result);
501+
});
502+
503+
// Using Promises
504+
505+
imagekit.bulkAddTags(["fileIds"], ["tags"]).then(response => {
506+
console.log(response);
507+
}).catch(error => {
508+
console.log(error);
509+
});
510+
```
511+
512+
**10. Bulk Remove tags**
513+
514+
Remove tags from multiple files in a single request as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/remove-tags-bulk). The method accepts an array of fileIDs of the files and an array of tags that have to be removed from those files.
515+
516+
```js
517+
// Using Callback Function
518+
519+
imagekit.bulkRemoveTags(["fileIds"], ["tags"], function(error, result) {
520+
if(error) console.log(error);
521+
else console.log(result);
522+
});
523+
524+
// Using Promises
525+
526+
imagekit.bulkRemoveTags(["fileIds"], ["tags"]).then(response => {
527+
console.log(response);
528+
}).catch(error => {
529+
console.log(error);
530+
});
531+
```
532+
533+
**11. Copy File**
534+
535+
This will copy a file from one folder to another as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-file). This method accepts source file's path and destination folder path.
536+
537+
```js
538+
// Using Callback Function
539+
540+
imagekit.copyFile("sourceFilePath", "destinationPath", function(error, result) {
541+
if(error) console.log(error);
542+
else console.log(result);
543+
});
544+
545+
// Using Promises
546+
547+
imagekit.copyFile("sourceFilePath", "destinationPath").then(response => {
548+
console.log(response);
549+
}).catch(error => {
550+
console.log(error);
551+
});
552+
```
553+
554+
**12. Move File**
555+
556+
This will move a file from one folder to another as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/move-file). This method accepts source file's path and destination folder path.
557+
558+
```js
559+
// Using Callback Function
560+
561+
imagekit.moveFile("sourceFilePath", "destinationPath", function(error, result) {
562+
if(error) console.log(error);
563+
else console.log(result);
564+
});
565+
566+
// Using Promises
567+
568+
imagekit.moveFile("sourceFilePath", "destinationPath").then(response => {
569+
console.log(response);
570+
}).catch(error => {
571+
console.log(error);
572+
});
573+
```
574+
575+
**13. Copy Folder**
576+
577+
This will copy one folder into another as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-folder). This method accepts source folder's path and destination folder path.
578+
579+
```js
580+
// Using Callback Function
581+
582+
imagekit.copyFolder("sourceFolderPath", "destinationPath", function(error, result) {
583+
if(error) console.log(error);
584+
else console.log(result);
585+
});
586+
587+
// Using Promises
588+
589+
imagekit.copyFolder("sourceFolderPath", "destinationPath").then(response => {
590+
console.log(response);
591+
}).catch(error => {
592+
console.log(error);
593+
});
594+
```
595+
596+
**14. Move Folder**
597+
598+
This will move one folder into another as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/move-folder). This method accepts source folder's path and destination folder path.
599+
600+
```js
601+
// Using Callback Function
602+
603+
imagekit.moveFolder("sourceFolderPath", "destinationPath", function(error, result) {
604+
if(error) console.log(error);
605+
else console.log(result);
606+
});
607+
608+
// Using Promises
609+
610+
imagekit.moveFolder("sourceFolderPath", "destinationPath").then(response => {
611+
console.log(response);
612+
}).catch(error => {
613+
console.log(error);
614+
});
615+
```
616+
617+
**15. Get bulk job status**
618+
619+
This allows us to get the status of a bulk operation e.g. copy or move folder as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/copy-move-folder-status). This method accepts jobID that is returned by copy and move folder operations.
620+
621+
```js
622+
// Using Callback Function
623+
624+
imagekit.getBulkJobStatus("jobId", function(error, result) {
625+
if(error) console.log(error);
626+
else console.log(result);
627+
});
628+
629+
// Using Promises
630+
631+
imagekit.getBulkJobStatus("jobId").then(response => {
632+
console.log(response);
633+
}).catch(error => {
634+
console.log(error);
635+
});
636+
```
637+
638+
**16. Create Folder**
639+
640+
This will create a new folder as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/create-folder). This method accepts folder name and parent folder path.
641+
642+
```js
643+
// Using Callback Function
644+
645+
imagekit.createFolder("folderName", "parentFolderPath", function(error, result) {
646+
if(error) console.log(error);
647+
else console.log(result);
648+
});
649+
650+
// Using Promises
651+
652+
imagekit.createFolder("folderName", "parentFolderPath").then(response => {
653+
console.log(response);
654+
}).catch(error => {
655+
console.log(error);
656+
});
657+
```
658+
659+
**17. Delete Folder**
660+
661+
This will delete the specified folder and all nested files & folders as per [API documentation here](https://docs.imagekit.io/api-reference/media-api/delete-folder). This method accepts full path of folder that is to be deleted.
662+
663+
```js
664+
// Using Callback Function
665+
666+
imagekit.deleteFolder("folderPath", function(error, result) {
667+
if(error) console.log(error);
668+
else console.log(result);
669+
});
670+
671+
// Using Promises
672+
673+
imagekit.deleteFolder("folderPath").then(response => {
462674
console.log(response);
463675
}).catch(error => {
464676
console.log(error);

0 commit comments

Comments
 (0)