Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

laravelphp

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

laravelphp - npm Package Compare versions

Comparing version 1.1.0 to 2.0.0

CHANGELOG.md

6

index.js

@@ -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) => {})
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc