Skip to content

Commit

Permalink
no type module
Browse files Browse the repository at this point in the history
  • Loading branch information
pim97 committed Jul 16, 2023
1 parent ce84821 commit ba720e0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Scrappey from "./wrapper/scrappey.js";
const Scrappey = require("./wrapper/scrappey.js");

const initialize = new Scrappey("API_KEY_HERE");

Expand Down
4 changes: 2 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import Scrappey from "./wrapper/scrappey.js";
const Scrappey = require("./wrapper/scrappey.js");

export default Scrappey
module.exports = Scrappey;
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"name": "scrappey-wrapper",
"version": "1.0.1",
"description": "",
"type": "module",
"main": "main.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
Expand Down
10 changes: 6 additions & 4 deletions wrapper/scrappey.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios";
const axios = require('axios').default;

export default class Scrappey {
class Scrappey {

constructor(apiKey) {
this.apiKey = apiKey;
Expand Down Expand Up @@ -70,7 +70,7 @@ export default class Scrappey {
*/
async sendRequest(dataOptions) {

const { endpoint, data } = dataOptions;
const { endpoint } = dataOptions;

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


}
}

module.exports = Scrappey;

0 comments on commit ba720e0

Please sign in to comment.