I downloaded printJS but I don't understand what I need to do to use it. Exactly what is to be loaded on my server? When I execute printJS("mypdf") I get an error about not recognizing "require".
Asked
Active
Viewed 1,472 times
0
-
1Possible duplicate of [What is this Javascript “require”?](http://stackoverflow.com/questions/9901082/what-is-this-javascript-require) – Mike Cluck Feb 06 '17 at 16:28
-
1Possible duplicate of [What is this Javascript "require"?](http://stackoverflow.com/questions/9901082/what-is-this-javascript-require) – Will Barnwell Feb 06 '17 at 18:10
-
1Here: https://jsfiddle.net/malt/sz8y92wx/1/ as on the project site have a working example. – MalT Feb 25 '17 at 12:57
-
Depending how your dev environment is, you may want to use the compiled file instead. Under the `dist` folder: `print.min.js`. http://printjs.crabbly.com/#documentation – crabbly Apr 12 '17 at 04:15
-
This project recently added ES6 module support and has many bugs having to do with import. I.E the module name is 'print.js' which won't work with import/require. Also the documentation is incorrect. The fiddle @MaIT posted is just a copy/paste of the incorrect example given which has nothing to do with importing the module. I would advise you to move on until the author fixes these issues, – Rorschach120 Apr 26 '17 at 15:12
-
@Rorschach120 What's wrong with the documentation? – crabbly Apr 26 '17 at 22:14
-
1@crabbly the section concerning usage with npm is either the wrong example or if it was intentional, then doesnt actually show you how to use the module with npm. On the readme it shows the 'npm install' but not how to use it in a project. – Rorschach120 Apr 26 '17 at 22:19
-
@Rorschach120 There is nothing wrong with the usage section. The installation section show you how to get the package, but does not go over how to import it. That could be added, however, the usage is the same. – crabbly Apr 26 '17 at 22:27