Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Storytelling Text Based Game Engine
Main part of Gaiman is a minimalistic language that generate Text Advanture Games.
This is basic Gaiman DLS example:
def ask_email(message)
set reply = ask message
if reply ~= /y|yes/i then
echo "OK"
else if reply ~= /n|no/i then
echo "FAIL"
else
global(message)
end
end
def global(command)
if command ~= /help/ then
echo "available commands help"
else if command ~= /ls/
echo get "/exec?command=ls"
else
echo "wrong command"
end
end
if cookie.visited then
if cookie.USER_NAME then
echo "hello $user"
else if cookie.EMAIL then
echo "Will contact with with any updates"
else
echo "Do you want me to contact you with updates?"
set confirm = ask "yes/no: "
if confirm ~= /y|yes/i then
echo "what is your name?"
set command = ask "name: "
if command then
set user = command
set cookie.user = command
set response = post "/register" { name: user, email: email }
if response then
echo "Welcome $user. You're successfully registered"
end
end
end
end
end
if/else
statementsfor
..in
while
do
..end
blocks#
return
keywordmap
/reduce
/filter
using gaimanjoin
/push
/pop
(maybe allow all JS methods)split
/replace
ord
/chr
ask
- set prompt
echo
- print message
get
- send HTTP GET request
post
- send HTTP POST request
set
- save expression or command into variable
exists
... in
- check if item is in array
parse
- parse string to number, boolean or regex
split
- to create array with string or regex separator
join
- return string from array
push
- item into array
pop
- remote item from
~=
$1
variables==
/<=
/>=
/<
/>
-=
, +=
, /=
, *=
operators ????-
, +
, /
, *
and %
operators<bold><red>hello</red></bold>
TODO: syntax example
echo <<GREET
____ _
/ ___| __ _(_)_ __ ___ __ _ _ __
| | _ / _` | | '_ ` _ \ / _` | '_ \
| |_| | (_| | | | | | | | (_| | | | |
\____|\__,_|_|_| |_| |_|\__,_|_| |_|
Gaiman Engine
Copyright (C) 2021 Jakub Jankiewicz <https://jcubic.pl/me>
Released under GPLv3 license
GREET
if location then
echo "Wellcome on this website"
else
echo "Wellcome to this CLI app"
end
var env = []
var items = ["bottle", "flower"]
set command = ask "? "
if command ~= /pick (.+)/ then
if $1 then
if exists $1 in items then
env.push($1)
pop items
else
echo "invalid item"
end
else
echo "What do you want topick"
end
end
var stop = false
var count = 0
while not stop do
var command = ask "? "
if command ~= /exit/
stop = true
echo "goodby"
else if command ~= /add ([0-9]+)/ then
count += parse $1
echo "corrent count $count"
else
echo "your command $command"
end
end
def once(fn)
var result = null
return lambda(...args)
if result == null then
result = fn(...args)
end
return result
end
end
def map(fn, array)
var result = []
for item in array do
result.push(fn(item))
end
return result
end
To consider
set
maybe foo = ??
is enoughpush
/pop
/split
/join
)command = ask "? "
should be compile to:
var command = await term.read('? ')
Compile:
do
var x = 10
echo x + x
end
x # throw exception x is not defined
to
{
let $_x = 10
term.echo($_x + $_x);
}
x
All names prefixed with $_
to solve conflicts
class Adapter {
constructor() { }
async ask(message) { }
echo(string) { }
async get(url) { }
async post(url, data) { }
start() { }
}
functon is_node() {
return typeof process !== 'undefined' &&
process.release.name === 'node';
}
var term, $_location, $_argv
if (is_node()) {
term = new NodeAdapter();
$_argv = process.argv;
} else {
term = new WebAdapter();
$_location = location;
}
term.start();
Name came from Neil Gaiman, Author of novels, comic books, graphic novels and films. Great storyteller.
Logo use:
Released under GPLv3 license
Copyright (c) 2021 Jakub T. Jankiewicz
FAQs
![Gaiman Text based advanture games engine](assets/banner.svg)
The npm package gaiman receives a total of 0 weekly downloads. As such, gaiman popularity was classified as not popular.
We found that gaiman demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.