Skip to content

v8 嵌入C++ 应用中并实现模块化加载 js 文件的例子(commonjs)

Notifications You must be signed in to change notification settings

huruji/v8-load-js-file

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v8-load-js-file

v8 嵌入 C++ 应用中并实现模块化加载 js 文件的例子(commonjs)

app.js

const test = require('test/test.js')

log(test.a)
log(test.add(2,3))

test.js

function add (a, b) {
    return a + b;
}
module.exports = {
    a: test,
    add,
}

运行

./demo test/app.js

About

v8 嵌入C++ 应用中并实现模块化加载 js 文件的例子(commonjs)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published