@apiverve/codedetector 1.1.10 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2024 APIVerve, and Evlar LLC
3
+ Copyright (c) 2025 APIVerve, and EvlarSoft LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -58,7 +58,9 @@ const api = new codedetectorAPI({
58
58
  Using the API is simple. All you have to do is make a request. The API will return a response with the data you requested.
59
59
 
60
60
  ```javascript
61
- var query = "a = 5\nb = 6\nc = 7\n\n# Uncomment below to take inputs from the user\n# a = float(input('Enter first side: '))\n# b = float(input('Enter second side: '))\n# c = float(input('Enter third side: '))\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)";
61
+ var query = {
62
+ "code": "a = 5\nb = 6\nc = 7\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)"
63
+ };
62
64
 
63
65
  api.execute(query, function (error, data) {
64
66
  if (error) {
@@ -76,7 +78,9 @@ api.execute(query, function (error, data) {
76
78
  You can also use promises to make requests. The API returns a promise that you can use to handle the response.
77
79
 
78
80
  ```javascript
79
- var query = "a = 5\nb = 6\nc = 7\n\n# Uncomment below to take inputs from the user\n# a = float(input('Enter first side: '))\n# b = float(input('Enter second side: '))\n# c = float(input('Enter third side: '))\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)";
81
+ var query = {
82
+ "code": "a = 5\nb = 6\nc = 7\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)"
83
+ };
80
84
 
81
85
  api.execute(query)
82
86
  .then(data => {
@@ -95,7 +99,9 @@ You can also use async/await to make requests. The API returns a promise that yo
95
99
 
96
100
  ```javascript
97
101
  async function makeRequest() {
98
- var query = "a = 5\nb = 6\nc = 7\n\n# Uncomment below to take inputs from the user\n# a = float(input('Enter first side: '))\n# b = float(input('Enter second side: '))\n# c = float(input('Enter third side: '))\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)";
102
+ var query = {
103
+ "code": "a = 5\nb = 6\nc = 7\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)"
104
+ };
99
105
 
100
106
  try {
101
107
  const data = await api.execute(query);
@@ -147,7 +153,7 @@ All usage of the APIVerve website, API, and services is subject to the [APIVerve
147
153
  ## License
148
154
  Licensed under the The MIT License (MIT)
149
155
 
150
- Copyright (©) 2025 APIVerve, and Evlar LLC
156
+ Copyright (©) 2025 APIVerve, and EvlarSoft LLC
151
157
 
152
158
  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
153
159
 
package/examples/basic.js CHANGED
@@ -14,7 +14,9 @@ const api = new codedetectorAPI({
14
14
  });
15
15
 
16
16
  // Example query
17
- var query = "a = 5\nb = 6\nc = 7\n\n# Uncomment below to take inputs from the user\n# a = float(input('Enter first side: '))\n# b = float(input('Enter second side: '))\n# c = float(input('Enter third side: '))\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)";
17
+ var query = {
18
+ "code": "a = 5\nb = 6\nc = 7\n\n# calculate the semi-perimeter\ns = (a + b + c) / 2\n\n# calculate the area\narea = (s*(s-a)*(s-b)*(s-c)) ** 0.5\nprint('The area of the triangle is %0.2f' %area)"
19
+ };
18
20
 
19
21
  // Make the API request using callback
20
22
  console.log('Making request to Code Detector API...\n');
package/index.d.ts CHANGED
@@ -7,10 +7,19 @@ declare module '@apiverve/codedetector' {
7
7
  export interface codedetectorResponse {
8
8
  status: string;
9
9
  error: string | null;
10
- data: any;
10
+ data: CodeDetectorData;
11
11
  code?: number;
12
12
  }
13
13
 
14
+
15
+ interface CodeDetectorData {
16
+ likelihood: number;
17
+ family: string;
18
+ current: string;
19
+ readable: string;
20
+ extension: string;
21
+ }
22
+
14
23
  export default class codedetectorWrapper {
15
24
  constructor(options: codedetectorOptions);
16
25
 
package/index.js CHANGED
@@ -58,7 +58,7 @@ class codedetectorWrapper {
58
58
  }
59
59
  }
60
60
 
61
- var requiredParams = ["text"];
61
+ var requiredParams = ["code"];
62
62
  if (requiredParams.length > 0) {
63
63
  for (var i = 0; i < requiredParams.length; i++) {
64
64
  if (!query[requiredParams[i]]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apiverve/codedetector",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "Code Detector is a simple tool for detecting the language of code in text. It returns details such as extension, language, family, and more.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -10,7 +10,8 @@
10
10
  },
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+https://github.com/apiverve/codedetector-API.git"
13
+ "url": "git+https://github.com/apiverve/codedetector-api.git",
14
+ "directory": "npm"
14
15
  },
15
16
  "keywords": [
16
17
  "code detector", "code detection", "code detect", "code api", "code tool"
@@ -18,7 +19,7 @@
18
19
  "author": "APIVerve <hello@apiverve.com> (http://apiverve.com/)",
19
20
  "license": "MIT",
20
21
  "bugs": {
21
- "url": "https://github.com/apiverve/codedetector-API/issues"
22
+ "url": "https://github.com/apiverve/codedetector-api/issues"
22
23
  },
23
24
  "homepage": "https://apiverve.com/marketplace/codedetector?utm_source=npm",
24
25
  "devDependencies": {
@@ -29,6 +30,6 @@
29
30
  "dependencies": {
30
31
  "node-fetch": "^3.3.2",
31
32
  "promise": "^8.3.0",
32
- "axios": "1.8.4"
33
+ "axios": "1.13.2"
33
34
  }
34
35
  }