0

I'm doing a project in laravel and i need to use this library (https://www.npmjs.com/package/lunar-calendar) but this is for node.js.

There is any chance to use this in my laravel project? I also find this library https://www.npmjs.com/package/php-require.

What i have to do?

Thank you

2
  • 3
    PHP is not JavaScript. So no, you can't run one from the other without doing something like a command line call to call the other file and return the result. Commented Mar 15, 2017 at 17:32
  • 1
    I don't understand the documentation, but it seems to me that this is a frontend library. You don't need node (backend) to use it, just copy it to you public folder, call it from you views and you're set. npm is just package manager, it's a convenient way to download libraries, but it's not a requirement. Commented Mar 15, 2017 at 19:02

1 Answer 1

2

No you cannot use JS library in PHP, And npm is a tool used to download libraries.

What you can do :

Get your library.

Copy it to your public folder and call it from the views based on your conditions.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.