33# ImageKit.io Node.js SDK
44
55[ ![ Node CI] ( https://github.com/imagekit-developer/imagekit-nodejs/workflows/Node%20CI/badge.svg )] ( https://github.com/imagekit-developer/imagekit-nodejs/ )
6- [ ![ npm version] ( https://img.shields.io/npm/v/imagekit )] ( https://www.npmjs.com/package/imagekit )
6+ [ ![ npm version] ( https://img.shields.io/npm/v/imagekit )] ( https://www.npmjs.com/package/imagekit )
77[ ![ codecov] ( https://codecov.io/gh/imagekit-developer/imagekit-nodejs/branch/master/graph/badge.svg )] ( https://codecov.io/gh/imagekit-developer/imagekit-nodejs )
88[ ![ Try imagekit on RunKit] ( https://badge.runkitcdn.com/imagekit.svg )] ( https://npm.runkit.com/imagekit )
99[ ![ License: MIT] ( https://img.shields.io/badge/License-MIT-yellow.svg )] ( https://opensource.org/licenses/MIT )
@@ -45,6 +45,10 @@ Use the following command to download this module. Use the optional `--save` par
4545```
4646npm install imagekit --save
4747# or
48+ pnpm install imagekit --save
49+ # or
50+ bun install imagekit // if you are using [Bun](https://bun.sh/) compiler
51+ # or
4852yarn add imagekit
4953```
5054
@@ -358,7 +362,7 @@ imagekit.upload({
358362 else console .log (result);
359363});
360364
361- // Using Promises
365+ // Using Promises
362366
363367imagekit .upload ({
364368 file : < url| base_64| binary> , // required
@@ -412,7 +416,7 @@ imagekit.listFiles({
412416});
413417
414418
415- // Using Promises
419+ // Using Promises
416420
417421imagekit .listFiles ({
418422 skip : 10 ,
@@ -437,7 +441,7 @@ imagekit.getFileDetails("file_id", function(error, result) {
437441});
438442
439443
440- // Using Promises
444+ // Using Promises
441445
442446imagekit .getFileDetails (" file_id" )
443447}).then (response => {
@@ -460,7 +464,7 @@ imagekit.getFileVersions("file_id", function(error, result) {
460464});
461465
462466
463- // Using Promises
467+ // Using Promises
464468
465469imagekit .getFileVersions (" file_id" )
466470}).then (response => {
@@ -486,7 +490,7 @@ imagekit.getFileVersionDetails({
486490});
487491
488492
489- // Using Promises
493+ // Using Promises
490494
491495imagekit .getFileVersionDetails ({
492496 fileId: " file_id" ,
@@ -508,7 +512,7 @@ Note: If `publish` is included in the update options, no other parameters are al
508512``` js
509513// Using Callback Function
510514
511- imagekit .updateFileDetails (" file_id" , {
515+ imagekit .updateFileDetails (" file_id" , {
512516 tags : [' image_tag' ],
513517 customCoordinates : " 10,10,100,100" ,
514518 extensions: [
@@ -524,7 +528,7 @@ imagekit.updateFileDetails("file_id", {
524528});
525529
526530
527- // Using Promises
531+ // Using Promises
528532
529533imagekit .updateFileDetails (" file_id" , {
530534 publish: {
@@ -614,7 +618,7 @@ imagekit.deleteFile("file_id", function(error, result) {
614618});
615619
616620
617- // Using Promises
621+ // Using Promises
618622
619623imagekit .deleteFile (" file_id" ).then (response => {
620624 console .log (response);
@@ -639,7 +643,7 @@ imagekit.deleteFileVersion({
639643});
640644
641645
642- // Using Promises
646+ // Using Promises
643647
644648imagekit .deleteFile ({
645649 fileId: " file_id" ,
@@ -664,7 +668,7 @@ imagekit.bulkDeleteFiles(["file_id_1", "file_id_2"], function(error, result) {
664668});
665669
666670
667- // Using Promises
671+ // Using Promises
668672
669673imagekit .bulkDeleteFiles ([" file_id_1" , " file_id_2" ]).then (response => {
670674 console .log (response);
@@ -923,7 +927,7 @@ imagekit.purgeCache("full_url", function(error, result) {
923927});
924928
925929
926- // Using Promises
930+ // Using Promises
927931
928932imagekit .purgeCache (" full_url" ).then (response => {
929933 console .log (response);
@@ -945,7 +949,7 @@ imagekit.getPurgeCacheStatus("cache_request_id", function(error, result) {
945949});
946950
947951
948- // Using Promises
952+ // Using Promises
949953
950954imagekit .getPurgeCacheStatus (" cache_request_id" ).then (response => {
951955 console .log (response);
@@ -966,7 +970,7 @@ imagekit.getFileMetadata("file_id", function(error, result) {
966970});
967971
968972
969- // Using Promises
973+ // Using Promises
970974imagekit .getFileMetadata (" file_id" )
971975}).then (response => {
972976 console .log (response);
@@ -985,7 +989,7 @@ imagekit.getFileMetadata("https://ik.imagekit.io/your_imagekit_id/sample.jpg", f
985989});
986990
987991
988- // Using Promises
992+ // Using Promises
989993imagekit .getFileMetadata (" https://ik.imagekit.io/your_imagekit_id/sample.jpg" )
990994}).then (response => {
991995 console .log (response);
@@ -1010,15 +1014,15 @@ imagekit.createCustomMetadataField(
10101014 minValue: 1000 ,
10111015 maxValue: 3000
10121016 }
1013- },
1017+ },
10141018 function (error , result ) {
10151019 if (error) console .log (error);
10161020 else console .log (result);
10171021 }
10181022);
10191023
10201024
1021- // Using Promises
1025+ // Using Promises
10221026
10231027imagekit .createCustomMetadataField (
10241028 {
@@ -1047,15 +1051,15 @@ Get the list of all custom metadata fields as per the [API documentation here](h
10471051imagekit .getCustomMetadataFields (
10481052 {
10491053 includeDeleted: false // optional
1050- },
1054+ },
10511055 function (error , result ) {
10521056 if (error) console .log (error);
10531057 else console .log (result);
10541058 }
10551059);
10561060
10571061
1058- // Using Promises
1062+ // Using Promises
10591063
10601064imagekit .getCustomMetadataFields (
10611065 {
@@ -1082,15 +1086,15 @@ imagekit.updateCustomMetadataField(
10821086 minValue: 500 ,
10831087 maxValue: 2500
10841088 }
1085- },
1089+ },
10861090 function (error , result ) {
10871091 if (error) console .log (error);
10881092 else console .log (result);
10891093 }
10901094);
10911095
10921096
1093- // Using Promises
1097+ // Using Promises
10941098
10951099imagekit .updateCustomMetadataField (
10961100 " field_id" ,
@@ -1099,7 +1103,7 @@ imagekit.updateCustomMetadataField(
10991103 minValue: 500 ,
11001104 maxValue: 2500
11011105 }
1102- },
1106+ },
11031107).then (response => {
11041108 console .log (response);
11051109}).catch (error => {
@@ -1123,7 +1127,7 @@ imagekit.deleteCustomMetadataField(
11231127);
11241128
11251129
1126- // Using Promises
1130+ // Using Promises
11271131
11281132imagekit .deleteCustomMetadataField (
11291133 " field_id"
0 commit comments