libjs
libc in JavaScript — libjs.
Usage
npm install libjs libsys
This library uses libsys
to execute system calls from JavaScript.
It expects your environment has libsys
global object, in Node.js you can shim libsys
as follows:
require('libsys/shim');
Examples
Reference
-
Synchronous system calls
-
Files:
read
,write
,open
,close
,access
,chmod
,fchmod
,chown
,fchown
,lchown
,truncate
,ftruncate
,lseek
,rename
,fsync
,fdatasync
-
Stats:
stat
,lstat
, andfstat
-
Directories:
mkdir
,mkdirat
,rmdir
,getcwd
,getdents64
,readdir
, andreaddirList
-
Links:
symlink
,unlink
,readlink
, andlink
-
Time:
utime
andutimes
-
Networking:
socket
,connect
,bind
,listen
,accept
,accept4
,shutdown
,send
,sendto
,recv
,recvfrom
,setsockopt
-
Process:
getpid
,getppid
,getuid
,geteuid
,getgid
,getegid
,sched_yield
,nanosleep
-
Events:
fcntl
,epoll_create
,epoll_create1
,epoll_wait
,epoll_ctl
,inotify_init
,inotify_init1
,inotify_add_watch
,inotify_rm_watch
-
Memory:
mmap
,munmap
,mprotect
,shmget
,shmat
,shmdt
, andshmctl
-
Files:
- Asynchronous system calls
-
Files:
readAsync
,writeAsync
,openAsync
,closeAsync
,accessAsync
,chmodAsync
,fchmodAsync
,chownAsync
,fchownAsync
,lchownAsync
,truncateAsync
,ftruncateAsync
,lseekAsync
,renameAsync
,fsyncAsync
,fdatasyncAsync
-
Stats:
statAsync
,lstatAsync
, andfstatAsync
-
Directories:
mkdirAsync
,mkdiratAsync
,rmdirAsync
,getcwdAsync
,getdents64Async
, andreaddirListAsync
-
Links:
symlinkAsync
,unlinkAsync
,readlinkAsync
, andlinkAsync
-
Time:
utimeAsync
andutimesAsync
-
Networking:
socketAsync
,connectAsync
,bindAsync
,listenAsync
,acceptAsync
,accept4Async
,shutdownAsync
,sendAsync
andsendtoAsync
, -
Process:
getpidAsync
,getppidAsync
,getuidAsync
,geteuidAsync
,getgidAsync
, andgetegidAsync
,
-
Files:
- Structs
-
epoll_event
,in_addr
,inotify_event
,ipc_perm
,ipv4
,linux_dirent64
,shmid_ds
,sigaction
,sockaddr
,sockaddr_in
,statStruct
,timespec
,timeval
,timevalarr
,utimbuf
-
- Sockets
-
flip
,htons32
,hton16
,htons
,Ip
,Ipv4
, andIpv6
,
-
- Constants
License
Unlicense — public domain.