@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 +1 -1
- package/README.md +10 -4
- package/examples/basic.js +3 -1
- package/index.d.ts +10 -1
- package/index.js +1 -1
- package/package.json +5 -4
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
The MIT License (MIT)
|
|
2
2
|
|
|
3
|
-
Copyright (c)
|
|
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 =
|
|
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 =
|
|
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 =
|
|
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
|
|
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 =
|
|
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:
|
|
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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@apiverve/codedetector",
|
|
3
|
-
"version": "1.1.
|
|
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-
|
|
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-
|
|
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.
|
|
33
|
+
"axios": "1.13.2"
|
|
33
34
|
}
|
|
34
35
|
}
|