Skip to content

Commit ba720e0

Browse files
committed
no type module
1 parent ce84821 commit ba720e0

File tree

4 files changed

+9
-8
lines changed

4 files changed

+9
-8
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Scrappey from "./wrapper/scrappey.js";
1+
const Scrappey = require("./wrapper/scrappey.js");
22

33
const initialize = new Scrappey("API_KEY_HERE");
44

main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import Scrappey from "./wrapper/scrappey.js";
1+
const Scrappey = require("./wrapper/scrappey.js");
22

3-
export default Scrappey
3+
module.exports = Scrappey;

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "scrappey-wrapper",
33
"version": "1.0.1",
44
"description": "",
5-
"type": "module",
65
"main": "main.js",
76
"scripts": {
87
"test": "echo \"Error: no test specified\" && exit 1"

wrapper/scrappey.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import axios from "axios";
1+
const axios = require('axios').default;
22

3-
export default class Scrappey {
3+
class Scrappey {
44

55
constructor(apiKey) {
66
this.apiKey = apiKey;
@@ -70,7 +70,7 @@ export default class Scrappey {
7070
*/
7171
async sendRequest(dataOptions) {
7272

73-
const { endpoint, data } = dataOptions;
73+
const { endpoint } = dataOptions;
7474

7575
if (!endpoint) {
7676
throw Error(`Endpoint is required, examples: request.get, request.post, sessions.create, sessions.destroy`)
@@ -108,4 +108,6 @@ export default class Scrappey {
108108
}
109109

110110

111-
}
111+
}
112+
113+
module.exports = Scrappey;

0 commit comments

Comments
 (0)