Skip to content

Commit 305df21

Browse files
Update Readme file
1 parent c97489c commit 305df21

File tree

1 file changed

+80
-0
lines changed

1 file changed

+80
-0
lines changed

README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Codegyan Node API Library
2+
3+
[![NPM version](https://img.shields.io/npm/v/codegyan)](https://npmjs.org/package/codegyan)
4+
5+
This library provides convenient access to the Codegyan REST API from TypeScript or JavaScript.
6+
7+
To learn how to use the OpenAI API, check out our and [Documentation](https://developer.codegyan.in/docs).
8+
9+
## Installation
10+
11+
You can install PHP Compiler Node via npm or yarn:
12+
13+
```bash
14+
# via npm
15+
npm install codegyan
16+
17+
# via yarn
18+
yarn add codegyan
19+
```
20+
21+
## Usage
22+
Before using the Pakage, you need to obtain an API key and client ID from Codegyan. Follow these steps to get your API credentials:
23+
24+
1. **Sign Up/Login**: If you don't have an account, sign up for a [Codegyan account](https://codegyan.in/account/signup.php). If you already have an account, log in to your dashboard.
25+
26+
2. **Get Credentials**: Once logged in, navigate to the [Developer Console](https://developer.codegyan.in/) or API settings in your account dashboard. Here, you will find your API key and client ID. Copy these credentials and use them when initializing the Pakage in your code.
27+
28+
Here's an example of how to initialize the npm pakage with your API key and Client ID:
29+
30+
```js
31+
import { Codegyan } from 'codegyan';
32+
33+
const API_KEY = "<YOUR_API_KEY>";
34+
const CLIENT_ID = "<YOUR_CLIENT_ID>";
35+
36+
// Initialize the Codegyan with your API key and client ID
37+
const client = new Codegyan(API_KEY, CLIENT_ID);
38+
39+
async function main() {
40+
// Example usage of the CompilerApiClient to compile code
41+
42+
// Example JavaScript code to compile
43+
const lang = 'python';
44+
const code = 'print("Hello, World!")';
45+
46+
// Call the compile method of the CompilerApiClient with JavaScript as the language
47+
client.compilerApiClient.compile(lang, code)
48+
.then(result => {
49+
// Log the compilation result
50+
console.log(result.data);
51+
})
52+
.catch(error => {
53+
// Handle any errors
54+
console.error('Error:', error);
55+
});
56+
}
57+
58+
main();
59+
```
60+
61+
Replace <YOUR_API_KEY> and <YOUR_CLIENT_ID> with your actual API key and Client ID provided by Codegyan. Pass the code you want to compile to the compile function.
62+
63+
## Semantic versioning
64+
65+
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
66+
67+
1. Changes that only affect static types, without breaking runtime behavior.
68+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
69+
3. Changes that we do not expect to impact the vast majority of users in practice.
70+
71+
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.
72+
73+
We are keen for your feedback; please open an [issue](https://www.github.com/codegyan/codegyan-node/issues) with questions, bugs, or suggestions.
74+
75+
76+
## Contributing
77+
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
78+
79+
## License
80+
This project is licensed under the MIT License. See the LICENSE file for details.

0 commit comments

Comments
 (0)