Git Product home page Git Product logo

Comments (8)

macbre avatar macbre commented on May 18, 2024

@shama, thanks for your interest in extending phantomas!

Please shed some light on "This way other modules could use this library as a dependency and extend it on npm.". I'm curious to know how can node.js based code use phantomas code (without running it via PhantomJS).

npm test example is really nice use case :)

I'm looking forward to see your implementation.

from phantomas.

shama avatar shama commented on May 18, 2024

Awesome! Glad to hear. I'll get started on an implementation to propose.

Here is how we're using phantomjs locally with Grunt: https://github.com/gruntjs/grunt-lib-phantomjs Our qunit and jasmine task use that library to run tests. It dynamically creates a tmp script file and spawns a locally installed phantomjs to run it. We have it tested across osx, windows, linux on node v0.8 and v0.10 currently.

from phantomas.

LaurentGoderre avatar LaurentGoderre commented on May 18, 2024

Hey @shama I did some local phantomjs as well. Need any help working on this?

from phantomas.

macbre avatar macbre commented on May 18, 2024

Random idea, guys. What do you think about phantomas module for NodeJS that will expose an API for spawning phantomas process and getting results?

var phantomas = require('phantomas');

phantomas(url, options, function(err, data) {
  // callback or promise pattern
});

from phantomas.

LaurentGoderre avatar LaurentGoderre commented on May 18, 2024

It would be a good idea.

from phantomas.

Libida avatar Libida commented on May 18, 2024

Hi,

phantomas doesn't work locally for me:

d:\Buildkit>phantomas --url http://localhost:8001/ --verbose
15:47:29.987 phantomas v1.10.0:
C:/Users/maryia_sinkevich/AppData/Roaming/npm/node_modules/phantomas/
15:47:29.988 Options: {"version":false,"V":false,"help":false,"h":false,"colors":false,
"disable-js":false,"no-externals":false,"progress":false,"silent":false,
"spy-eval":false,"verbose":true,"v":true,"scroll":false,"film-strip":false, "analyze-css":false,
"page-source":false,"reporter":"plain","R":"plain","format":"plain","timeout":15,
"url":"http://localhost:8001/","user-agent":"phantomas/1.10.0 (PhantomJS/1.9.8; win32 x64)"}
...
15:47:30.044 req: <http://localhost:8001/>
15:47:30.044 Event send emitted
15:47:30.045 Event pageOpen emitted
15:47:30.045 Timeout set to 15 sec
15:47:30.046 Page loading started
15:47:30.046 Event loadStarted emitted
15:47:30.092 Loading progress: 10%
15:47:30.092 Event progress emitted
15:47:34.073 Event onResourceReceived emitted
15:47:34.074 Blocked request by phantomjs: <http://localhost:8001/>
15:47:34.074 Event abort emitted
15:47:34.075 recv: "start" stage not registered for <http://localhost:8001/>!
15:47:34.075 contentLength missing: {"url":"http://localhost:8001/"}
15:47:34.076 recv: HTTP 200 <http://localhost:8001/> [undefined]
15:47:34.076 Event recv emitted
15:47:34.076 Event metric emitted
15:47:34.077 Event metric emitted
15:47:34.077 Time to first byte: set to NaN ms for #1 request to <http://localhost:8001/> 
(HTTP 200)
15:47:34.077 Time to last byte: set to 4030 ms
15:47:34.077 Event responseEnd emitted
15:47:34.078 Block domains: assuming "localhost" to be the main domain
15:47:34.078 Event metric emitted
15:47:34.078 Performance timing: responseEnd = 1428421654078
15:47:34.078 Event milestone emitted
15:47:34.083 Page loading finished ("fail")
15:47:34.083 Event loadFailed emitted
15:47:34.083 Exiting with code #254 (Page loading failed)!
15:47:34.083 Event exit emitted phantomas: (254) Page loading failed
15:47:34.097 phantomas scope injected

Could you please help in resolving this issue.
Timeout increasing didn't help.

from phantomas.

macbre avatar macbre commented on May 18, 2024

What does curl -sv http://localhost:8001 > /dev/null shows?

from phantomas.

Libida avatar Libida commented on May 18, 2024

Thank you for your response.

d:\Buildkit>curl -sv http://localhost:8001 > /dev/null
The system cannot find the path specified.

My mistake, didn't observe that server was stopped.
Now everything is working.

from phantomas.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.