title: How to convert std::string to v8's Local<string>
body: <p>I have a function which is ment to take in a string and then pass it to my c++ function <code>add_node()</code></p>
  
  <pre><code>Handle&lt;Value&gt; Graph::add_node(const v8::Arguments&amp; args)
  {
    HandleScope scope;
  
    Graph* graph = ObjectWrap::Unwrap&lt;Graph&gt;(args.This());
    graph-&gt;add_node( args[0]-&gt;ToString() );
  
    std::cout &lt;&lt; "In add node \n";
  }
  </code></pre>
  
  <p>However I'm having trouble because all of my arguments are v8 templetes of some sort or another and I cant figure out how to switch between the two. The <a href="http://bespin.cz/~ondras/html/classv8_1_1String.html">documentation</a> doesn't state it clearly either. </p>
  
  <p>The compiler is giving me this error </p>
  
  <pre><code>../graph/binding.cc:52:10: error: no matching member function for call to
        'add_node'
    graph-&gt;add_node( args[0]-&gt;ToString() );
    ~~~~~~~^~~~~~~~
  ../graph/directed_graph.h:27:7: note: candidate function not viable: no known
        conversion from 'Local&lt;v8::String&gt;' to 'std::string &amp;' (aka
        'basic_string&lt;char&gt; &amp;') for 1st argument;
          void add_node( std::string &amp; currency );
  </code></pre>
  
  <p>How can I switch between <code>Local&lt;v8::String&gt;</code> and <code>std::string &amp;</code>?</p>