jint .net js 引擎

jint 是一个 .net js 引擎

一些运行场景

  • .net 应用安全的运行js(沙箱环境)
  • 暴露native .net 对象到js 引擎中
  • 脚本化应用中

简单使用

using Jint;
var engine = new Engine()
    .SetValue("log", new Action<object>(Console.WriteLine));
    
engine.Execute(@"
    function hello() { 
        log('Hello World');
    };
 
    hello();
");

说明

目前Ravendb,eventstore,OrchardCore,JavaScriptEngineSwitcher 等不少都有使用到

参考资料

https://github.com/sebastienros/jint

https://github.com/EventStore/EventStore

https://github.com/OrchardCMS/OrchardCore

https://github.com/elsa-workflows/elsa-core

https://github.com/dotnet/docfx

https://github.com/adams85/acornima

https://github.com/Taritsyn/JavaScriptEngineSwitcher

posted on   荣锋亮  阅读(40)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2023-11-25 wasmer 基于webassembly 的平台
2023-11-25 emscripten cmake 简单尝试
2022-11-25 graylog 新版本报警处理
2021-11-25 oceanbase 资源池删除说明
2021-11-25 基于obd 的oceanbase 扩容说明
2021-11-25 oceanbase 普通租户root 默认密码安全问题
2020-11-25 jdk 容器运行环境指定时区

导航

< 2025年3月 >
23 24 25 26 27 28 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 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示