File: env_misc.cc

package info (click to toggle)
node-addon-api 8.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,248 kB
  • sloc: cpp: 15,431; javascript: 5,631; ansic: 157; makefile: 7
file content (25 lines) | stat: -rw-r--r-- 447 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "napi.h"
#include "test_helper.h"

#if (NAPI_VERSION > 8)

using namespace Napi;

namespace {

Value GetModuleFileName(const CallbackInfo& info) {
  Env env = info.Env();
  return String::New(env, env.GetModuleFileName());
}

}  // end anonymous namespace

Object InitEnvMiscellaneous(Env env) {
  Object exports = Object::New(env);

  exports["get_module_file_name"] = Function::New(env, GetModuleFileName);

  return exports;
}

#endif