nikaia/php-node-bridge
最新稳定版本:v1.0.0
Composer 安装命令:
composer require nikaia/php-node-bridge
包简介
Call your NodeJS scripts from Php
README 文档
README
Call your NodeJS scripts from Php
Installation
You can install the package via composer:
composer require nikaia/php-node-bridge
Usage
The bridge work by executing a node script that accept piped json arbitary data, and returns json response.
check tests/_fixtures/ok.script.js for a working example.
use Nikaia\NodeBridge\Bridge; try { $response = Bridge::create() ->setNode('/usr/local/bin/node') // the path to the node (You can omit if in system path) ->setScript('/path/to/your/script.js') // the path to your script ->pipe(['foo' => 'bar']) // the data to pipe to the script ->run(); } catch (BridgeException $e) { echo $e->getMessage(); } var_dump($response->json()); // ['foo' => 'bar'] var_dump($response->output()); // the raw output of the script {"foo":"bar"}
Changelog
Please see CHANGELOG for more information on what has changed recently.
Releases
This package use semver releases. Releases are managed using standard-version node package, and requires adhering to conventionalcommit commit styles.
- Implement a feature or a fix etc.
- Use commit message like
fix: Fix an issueorfeat: Implement a feature ... - Or rewrite the commit message while squashing/closing the PR!!
- Update your local project, checkout
mainbranch - Run :
composer releaseto generate changelog, and to tag to new release. - Check everything is okay.
- Push the tag using
git push --follow-tags origin main
This repository is using Semantic Pull Request bot to enforce conventional commit message and PR titles
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-11-16