Skip to content

PHP Compiler Node is a Node.js package for compiling PHP code using the Codegyan PHP compiler API.

License

Notifications You must be signed in to change notification settings

Codegyan-LLC/php-compiler-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHP Compiler Node

npm version npm downloads npm collaborators npm bundle size

PHP Compiler Node is a Node.js package for compiling PHP code using the Codegyan PHP compiler API.

Installation

You can install PHP Compiler Node via npm or yarn:

# via npm
npm install php-compiler-node

# via yarn
yarn add php-compiler-node

Usage

Before using the Pakage, you need to obtain an API key and client ID from Codegyan. Follow these steps to get your API credentials:

  1. Sign Up/Login: If you don't have an account, sign up for a Codegyan account. If you already have an account, log in to your dashboard.

  2. Get Credentials: Once logged in, navigate to the Developer Console 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.

Here's an example of how to initialize the npm pakage with your API key and client ID:

import compilePhpCode from 'php-compiler-node';

const API_KEY = "<YOUR_API_KEY>";
const CLIENT_ID = "<YOUR_CLIENT_ID>";

const code = '<?php echo "Hello World!"; ?>';

compilePhpCode(API_KEY, CLIENT_ID, code)
    .then((status) => {
        console.log(status.output);
    })
    .catch((error) => {
        console.error('Compilation Error:', error);
    });

Replace <YOUR_API_KEY> and <YOUR_CLIENT_ID> with your actual API key and client ID provided by Codegyan. Pass the PHP code you want to compile to the compilePhpCode function.

Contributing

Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests to help improve this pakage.

License

This Codegyan SDK is open-sourced software licensed under the MIT license.

About

PHP Compiler Node is a Node.js package for compiling PHP code using the Codegyan PHP compiler API.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published