Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/plastbox/npm_require
Allows the use of npm modules in php.
https://github.com/plastbox/npm_require
Last synced: about 1 month ago
JSON representation
Allows the use of npm modules in php.
- Host: GitHub
- URL: https://github.com/plastbox/npm_require
- Owner: plastbox
- Created: 2016-02-23T18:55:22.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-21T12:31:06.000Z (almost 8 years ago)
- Last Synced: 2024-10-31T12:29:54.596Z (3 months ago)
- Language: PHP
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# npm_require
Allows the use of npm modules in php.Usage
-----
Download and include **npm_require.php**, and use the function *npm_require()* to include an npm module. The returned object should contain all the methods/properties you'd expect if you were using it in node.jsExample
-------
Using [reminyborg/aggsy](https://github.com/reminyborg/aggsy) and its usage example.```php
'volvo', 'km'=> 100),
array('model'=> 'tesla', 'make'=> 's', 'km'=> 200),
array('model'=> 'tesla', 'make'=> 's', 'km'=> 120)
);print_r($aggsy('model(_sum(km),_count())', $cars));
/* Outputs:
stdClass Object
(
[volvo] => stdClass Object
(
[_sum(km)] => 100
[_count()] => 1
)[tesla] => stdClass Object
(
[_sum(km)] => 320
[_count()] => 2
))
*/
```