Skip to content

Commit 37f2565

Browse files
committed
adding RunKit badge and package.json for sample applicaiton
1 parent 63925a7 commit 37f2565

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[![Node CI](https://github.com/imagekit-developer/imagekit-nodejs/workflows/Node%20CI/badge.svg)](https://github.com/imagekit-developer/imagekit-nodejs/)
77
[![npm version](https://img.shields.io/npm/v/imagekit)](https://www.npmjs.com/package/imagekit)
88
[![codecov](https://codecov.io/gh/imagekit-developer/imagekit-nodejs/branch/master/graph/badge.svg)](https://codecov.io/gh/imagekit-developer/imagekit-nodejs)
9+
[![Try imagekit on RunKit](https://badge.runkitcdn.com/imagekit.svg)](https://npm.runkit.com/imagekit)
910
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
1011
[![Twitter Follow](https://img.shields.io/twitter/follow/imagekitio?label=Follow&style=social)](https://twitter.com/ImagekitIo)
1112

@@ -28,7 +29,9 @@ ImageKit Node.js SDK allows you to use [image resizing](https://docs.imagekit.io
2829
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.
2930

3031
```
31-
npm install imagekit
32+
npm install imagekit --save
33+
# or
34+
yarn add imagekit
3235
```
3336

3437
## Initialization
@@ -43,9 +46,8 @@ var imagekit = new ImageKit({
4346
});
4447
```
4548

46-
4749
## Demo application
48-
The fastest way to get started is by running the demo application in [sample](/sample) folder.
50+
The fastest way to get started is by running the demo application in [sample](/sample) folder. Refer to the README file in [sample](/sample) folder.
4951

5052
## Usage
5153
You can use this NodeJS SDK for three different kinds of functions - URL generation, file uploads, and file management. The usage of the SDK has been explained below.

sample/README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Running the sample application
2+
3+
### Step 1: Install dependencies
4+
```bash
5+
npm install
6+
```
7+
8+
### Step 2: Enter account details
9+
Open `index.js` and fill the account details:
10+
```js
11+
const CONFIG_OPTIONS = {
12+
publicKey: "your_public_api_key",
13+
privateKey: "your_private_api_key",
14+
urlEndpoint: "https://ik.imagekit.io/your_imagekit_id/",
15+
};
16+
```
17+
18+
### Step 3:
19+
Run the `index.js`

sample/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const ImageKit = require("../dist/");
1+
const ImageKit = require("imagekit");
22
const fs = require("fs");
33
const path = require("path");
44

sample/package.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "sample",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"dependencies": {
10+
"imagekit": "*"
11+
},
12+
"author": "",
13+
"license": "ISC"
14+
}

0 commit comments

Comments
 (0)