## Script
NAN provides `v8::Script` helpers as the API has changed over the supported versions of V8.
- Nan::CompileScript()
- Nan::RunScript()
- Nan::ScriptOrigin
### Nan::CompileScript()
A wrapper around [`v8::ScriptCompiler::Compile()`](https://v8docs.nodesource.com/node-8.16/da/da5/classv8_1_1_script_compiler.html#a93f5072a0db55d881b969e9fc98e564b).
Note that `Nan::BoundScript` is an alias for `v8::Script`.
Signature:
```c++
Nan::MaybeLocal Nan::CompileScript(
v8::Local s,
const v8::ScriptOrigin& origin);
Nan::MaybeLocal Nan::CompileScript(v8::Local s);
```
### Nan::RunScript()
Calls `script->Run()` or `script->BindToCurrentContext()->Run(Nan::GetCurrentContext())`.
Note that `Nan::BoundScript` is an alias for `v8::Script` and `Nan::UnboundScript` is an alias for `v8::UnboundScript` where available and `v8::Script` on older versions of V8.
Signature:
```c++
Nan::MaybeLocal Nan::RunScript(v8::Local script)
Nan::MaybeLocal Nan::RunScript(v8::Local script)
```
### Nan::ScriptOrigin
A class transparently extending [`v8::ScriptOrigin`](https://v8docs.nodesource.com/node-16.0/db/d84/classv8_1_1_script_origin.html#pub-methods)
to provide backwards compatibility. Only the listed methods are guaranteed to
be available on all versions of Node.
Declaration:
```c++
class Nan::ScriptOrigin : public v8::ScriptOrigin {
public:
ScriptOrigin(v8::Local name, v8::Local line = v8::Local(), v8::Local column = v8::Local())
v8::Local ResourceName() const;
v8::Local ResourceLineOffset() const;
v8::Local ResourceColumnOffset() const;
}
```