New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

windscript

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

windscript

Deal with WS File

unpublished
latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

WindScript

WindScript是一种解释性语言(不保证其速度,仅供娱乐),简称WS

  • WindScript

运行

你可以使用命令行工具WScmd.js来运行 或者使用nodejs模块windscript.js来运行

WScmd.js

WScmd是使用node编写的命令行工具,提供了运行WS文件的方法以及WS RLrun交互模式

运行WS文件

在终端输入node .\WScmd.js -f <path>会运行path处的WS文件 示例:

$ node .\WScmd.js -f .\template\helloworld.ws
Hello world!
This message by the template
This is a warn message      
This is an error message 

以上代码运行了 ./template/helloworld.ws 的WS文件

WS RLrun交互模式

在终端输入node .\WScmd.js会进入WS RLrun交互模式

$ node .\WScmd.js
Welcome to WindScript RLrun v0.0.1
Press Ctrl+D to exit the RLrun

> {Num} a = 0
0

> ==> a
0

> {Num} a = 114514;
114514

> ==> a;
114514

>

windscript.js

windscript是一个nodejs模块,提供了运行WS文件的方法,你可以使用windscript模块在你的js代码中运行WS文件

快速开始

模块引入方法 示例代码:template-run.js

const WSrun = require("windscript");

const project = new WSrun();

project
    .setPath("./template/helloworld.ws")
    .run();

示例代码:helloworld.ws

{Str} text = Hello world!;
==> text;
{Str} text = This message by the template;
==> text;
{Str} w = This is a warn message;
W==> w;
{Str} E = This is an error message;
E==> E;

运行

$ node .\template\template-run.js
Hello world!
This message by the template
This is a warn message      
This is an error message

路径运行

首先引入模块 然后定义一个WSrun类 使用 setPatn(path) 将WSrun类的运行文件路径设置为path 使用 run() 运行WSrun类读取到的代码

const WSrun = require("windscript");

const project = new WSrun();

project
    .setPath("./template/helloworld.ws")
    .run();

以上代码会运行位于 ./template/helloworld.ws 处的WS文件

代码运行

首先引入模块 然后定义一个WSrun类 使用 setCode(code) 将WSrun类的运行文件路径设置为code 使用 run() 运行WSrun类读取到的代码

const WSrun = require("windscript");

const project = new WSrun();

project
    .setCode("{Str} E = This is an error message;\nE==> E;")
    .run();

以上代码会使用WS运行

{Str} E = This is an error message;
E==> E;

FAQs

Package last updated on 12 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts