Comparing version 1.1.0 to 2.0.0
@@ -1,4 +0,2 @@ | ||
module.exports = { | ||
laravel2js: require('./laravel2js'), | ||
js2laravel: require('./js2laravel') | ||
}; | ||
import backend from './lib/index.js' | ||
export default backend |
{ | ||
"name": "laravelphp", | ||
"version": "1.1.0", | ||
"version": "2.0.0", | ||
"description": "laravel2js and js2laravel converter laravel php resource utils", | ||
"main": "index.js", | ||
"engines": { | ||
"node": ">=6.0.0" | ||
"type": "module", | ||
"main": "./cjs/index.js", | ||
"exports": { | ||
".": { | ||
"require": "./cjs/index.js", | ||
"default": "./lib/index.js" | ||
}, | ||
"./laravel2js": { | ||
"require": "./cjs/laravel2js.js", | ||
"default": "./lib/laravel2js.js" | ||
}, | ||
"./js2laravel": { | ||
"require": "./cjs/js2laravel.js", | ||
"default": "./lib/js2laravel.js" | ||
} | ||
}, | ||
"module": "./lib/index.js", | ||
"dependencies": { | ||
"php-parser": "3.0.0-prerelease.7" | ||
"php-parser": "3.0.0" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.9.0", | ||
"expect.js": "^0.3.1", | ||
"mocha": "^5.2.0" | ||
"@babel/cli": "7.8.4", | ||
"@babel/core": "7.9.0", | ||
"@babel/preset-env": "7.9.5", | ||
"babel-plugin-add-module-exports": "1.0.2", | ||
"browserify": "16.5.1", | ||
"eslint": "6.8.0", | ||
"eslint-config-standard": "14.1.1", | ||
"eslint-plugin-import": "2.20.2", | ||
"eslint-plugin-node": "11.1.0", | ||
"eslint-plugin-promise": "4.2.1", | ||
"eslint-plugin-require-path-exists": "1.1.9", | ||
"eslint-plugin-standard": "4.0.1", | ||
"expect.js": "0.3.1", | ||
"mocha": "7.1.1", | ||
"uglify-js": "3.9.1" | ||
}, | ||
"scripts": { | ||
"lint": "eslint .", | ||
"test": "npm run lint && mocha test" | ||
"compile": "rm -rf cjs && mkdir cjs && babel lib -d cjs --presets=@babel/preset-env --plugins=add-module-exports && echo '{\"type\":\"commonjs\"}' > cjs/package.json", | ||
"browser": "browserify --standalone laravelphp cjs/index.js -o laravelphp.js && uglifyjs laravelphp.js --compress --mangle -o laravelphp.min.js", | ||
"build": "npm run compile && npm run browser", | ||
"test": "npm run lint && npm run build && mocha test -R spec", | ||
"preversion": "npm run test && npm run build && git push", | ||
"postversion": "git push && git push --tags" | ||
}, | ||
@@ -21,0 +51,0 @@ "keywords": [ |
@@ -13,12 +13,18 @@ [![travis](https://img.shields.io/travis/locize/laravelphp.svg)](https://travis-ci.org/locize/laravelphp) [![npm](https://img.shields.io/npm/v/laravelphp.svg)](https://npmjs.org/package/laravelphp) | ||
You can then `require()` laravel as normal: | ||
You can then `import` or `require()` laravel as normal: | ||
```js | ||
const laravelphp = require('laravelphp'); | ||
import resx from 'resx' | ||
// or | ||
const laravelphp = require('laravelphp') | ||
laravelphp.laravel2js(php, (err, res) => {}) | ||
``` | ||
Or you can direclty `require()` its functions: | ||
Or you can direclty `import` or `require()` its functions: | ||
```js | ||
const laravel2js = require('laravelphp/laravel2js'); | ||
import resx2js from 'laravelphp/laravel2js' | ||
// or | ||
const resx2js = require('laravelphp/cjs/laravel2js') | ||
``` | ||
@@ -32,16 +38,19 @@ | ||
return [ | ||
'key1' => 'Hello', | ||
'key1' => 'Hello! Let\'s go!', | ||
'key2' => 'An application to manipulate and process laravel php language files', | ||
'key.nested' => 'laravel Data Manager' | ||
]; | ||
?>`; | ||
'key' => [ | ||
'nested' => 'laravel Data Manager' | ||
] | ||
];` | ||
const js = { | ||
"key1": "Hello", | ||
"key1": "Hello! Let's go!", | ||
"key2": "An application to manipulate and process laravel php language files", | ||
"key.nested": "laravel Data Manager" | ||
}; | ||
"key": { | ||
"nested": "laravel Data Manager" | ||
} | ||
} | ||
const laravel2js = require('laravelphp/laravel2js'); | ||
import laravel2js from 'laravelphp/laravel2js' | ||
laravel2js(php, (err, res) => { | ||
@@ -51,3 +60,3 @@ // res is like js | ||
const js2laravel = require('laravelphp/js2laravel'); | ||
import js2laravel from 'laravelphp/js2laravel' | ||
js2laravel(js, (err, res) => { | ||
@@ -58,1 +67,11 @@ // res is like php | ||
``` | ||
Omitting the callback returns a promise | ||
```js | ||
const resJs = await laravel2js(php) | ||
const resPhp = await js2laravel(js) | ||
// or | ||
laravel2js(php).then((res) => {}) | ||
js2laravel(js).then((res) => {}) | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
433689
13
9590
73
Yes
15
1
6
1
+ Addedphp-parser@3.0.0(transitive)
- Removedphp-parser@3.0.0-prerelease.7(transitive)
Updatedphp-parser@3.0.0