@@ -56,6 +56,8 @@ If you don't have any credentials, you'll need to:
56561 . [ Create an Imgur account] ( https://imgur.com/register )
57571 . [ Register an application] ( https://api.imgur.com/#registerapp )
5858
59+ ### ** ⚠️ For brevity, the rest of the examples will leave out the import and/or instantiation step.**
60+
5961### Upload one or more images and videos
6062
6163You can upload one or more files by simply passing a path to a file or array of paths to multiple files.
@@ -118,8 +120,6 @@ Acceptable key/values match what [the Imgur API expects](https://apidocs.imgur.c
118120Instances of ` ImgurClient ` emit ` uploadProgress ` events so that you can track progress with event listeners.
119121
120122``` ts
121- import { ImgurClient } from ' imgur' ;
122-
123123const client = new ImgurClient ({ accessToken: process .env .ACCESS_TOKEN });
124124
125125client .on (' uploadProgress' , (progress ) => console .log (progress ));
@@ -143,3 +143,46 @@ The progress object looks like the following:
143143| ` transferred ` | total number of bytes transferred thus far |
144144| ` total ` | total number of bytes to be transferred |
145145| ` id ` | unique id for the media being transferred; useful when uploading multiple things concurrently |
146+
147+ ### Delete an image
148+
149+ Requires an image hash or delete hash, which are obtained in an image upload response
150+
151+ ``` ts
152+ client .delete (' someImageHash' );
153+ ```
154+
155+ ### Update image information
156+
157+ Update the title and/or description of an image
158+
159+ ``` ts
160+ client .updateImage ({
161+ imageHash: ' someImageHash' ,
162+ title: ' A new title' ,
163+ description: ' A new description' ,
164+ });
165+ ```
166+
167+ Update multiple images at once:
168+
169+ ``` ts
170+ client .updateImage ([
171+ {
172+ imageHash: ' someImageHash' ,
173+ title: ' A new title' ,
174+ description: ' A new description' ,
175+ },
176+ {
177+ imageHash: ' anotherImageHash' ,
178+ title: ' A better title' ,
179+ description: ' A better description' ,
180+ },
181+ ]);
182+ ```
183+
184+ Favorite an image:
185+
186+ ``` ts
187+ client .favoriteImage (' someImageHash' );
188+ ```
0 commit comments