New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

dr-js

Package Overview
Dependencies
Maintainers
1
Versions
243
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dr-js - npm Package Compare versions

Comparing version 0.22.3 to 0.23.0-dev.0

4

bin/index.js

@@ -36,3 +36,3 @@ #!/usr/bin/env node

"eval-readline"===b&&(t=await(0,w.evalReadlineExtend)(t,O("root"),A))
return void 0!==t&&(e=>F?(0,r.writeFileSync)(F,e):(0,n.pipeStreamAsync)(process.stdout,(0,n.bufferToStream)(e)))(t instanceof Buffer?t:Buffer.from(String(t)))}case"repl":return(0,t.start)({prompt:"> ",input:process.stdin,output:process.stdout,useGlobal:!0}).context.require=require
return void 0!==t&&(e=>F?(0,r.writeFileSync)(F,e):(0,n.pipeStreamAsync)(process.stdout,(0,n.bufferToReadableStream)(e)))(t instanceof Buffer?t:Buffer.from(String(t)))}case"repl":return(0,t.start)({prompt:"> ",input:process.stdin,output:process.stdout,useGlobal:!0}).context.require=require
case"wait":{const e=P[0]||2e3

@@ -68,3 +68,3 @@ return(0,o.setTimeoutAsync)(e)}case"echo":return h(P)

const a=(0,s.prettyStringifyJSON)(t,e)
return(0,r.writeFileSync)(F||x,a)}case"server-serve-static":case"server-serve-static-simple":{const[e=3e5]=P
return(0,r.writeFileSync)(F||x,a)}case"server-serve-static":case"server-serve-static-simple":{const[e=5e3]=P
const r="server-serve-static-simple"===b

@@ -71,0 +71,0 @@ const t=T("root")||process.cwd()

var e=require("../library/node/module/Option/preset")
const t=(...t)=>t.map(t=>e.Preset.parseCompact(t,{optional:!0}))
const o=t("help,h/T|show full help","quiet,q/T|less log","version,v/T|show version","json,J/T|output JSON, if supported","host,H/SS|common option: $0=hostname:port (hostname default to 0.0.0.0)","root,R/SP|common option: $0=path/cwd","input-file,I/SP|common option","output-file,O/SP|common option")
const s=t("eval,e/A|eval file or string: -O=outputFile, -I/$0=scriptFile/scriptString, $@=...evalArgv","eval-readline,erl/A|eval with readline: -R=readlineFile, ...eval","repl,i/T|start node REPL","wait/AI/0-1|wait specified time, in msec: $0=waitTime/2*1000","echo/A|show args: $@=...args","cat/AP/0-|with 0 args pipe stdin to stdout, else read $@ as file and pipe to stdout",'write/SP|for use like ">": `dr-js --cat sourceFile | dr-js --write outputFile`','append/SP|for use like ">>": `dr-js --cat sourceFile | dr-js --append outputFile`',"open,o//0-1|use system default app to open uri or path: $0=uriOrPath/cwd","status,s/T|basic system status: -J=isOutputJSON","file-list,ls/AP/0-1|list file: $0=path/cwd","file-list-all,ls-R,lla/AP/0-1|list all file: $0=path/cwd","file-tree,tree/AP/0-1|list all file in tree: $0=path/cwd","file-create-directory,mkdir/AP/0-|create directory: $@=...pathList","file-modify-copy,cp/AP/2|copy path: $@=pathFrom,pathTo","file-modify-move,mv/AP/2|move path: $@=pathFrom,pathTo","file-modify-delete,rm/AP/0-|delete path: $@=...pathList","file-merge,merge/AP/2-|merge to one file: $@=mergedFile,...inputFileList",'fetch,f//1-3|fetch "GET" uri: -O=outputFile/stdout, $@=initialUrl,jumpMax/4,timeout/0','process-status,ps//0-1|show system process status: -J=isOutputJSON, $0=outputMode/"pid--"',"json-format,jf/AI/0-1|re-format JSON file: -O=outputFile/-I, -I=inputFile, $0=unfoldLevel/2","server-serve-static,sss//0-1|static file server: -H=hostname:port, -R=staticRoot/cwd, $0=expireTime/5*60*1000","server-serve-static-simple,ssss//0-1|static file server, no HTML: -H=hostname:port, -R=staticRoot/cwd, $0=expireTime/5*60*1000","server-websocket-group,swg|websocket chat server: -H=hostname:port","server-test-connection,stc|connection test server: -H=hostname:port","server-tcp-proxy,stp//1-|tcp proxy server: -H=hostname:port, $@=toHostname:toPort,toHostname:toPort,...")
const s=t("eval,e/A|eval file or string: -O=outputFile, -I/$0=scriptFile/scriptString, $@=...evalArgv","eval-readline,erl/A|eval with readline: -R=readlineFile, ...eval","repl,i/T|start node REPL","wait/AI/0-1|wait specified time, in msec: $0=waitTime/2*1000","echo/A|show args: $@=...args","cat/AP/0-|with 0 args pipe stdin to stdout, else read $@ as file and pipe to stdout",'write/SP|for use like ">": `dr-js --cat sourceFile | dr-js --write outputFile`','append/SP|for use like ">>": `dr-js --cat sourceFile | dr-js --append outputFile`',"open,o//0-1|use system default app to open uri or path: $0=uriOrPath/cwd","status,s/T|basic system status: -J=isOutputJSON","file-list,ls/AP/0-1|list file: $0=path/cwd","file-list-all,ls-R,lla/AP/0-1|list all file: $0=path/cwd","file-tree,tree/AP/0-1|list all file in tree: $0=path/cwd","file-create-directory,mkdir/AP/0-|create directory: $@=...pathList","file-modify-copy,cp/AP/2|copy path: $@=pathFrom,pathTo","file-modify-move,mv/AP/2|move path: $@=pathFrom,pathTo","file-modify-delete,rm/AP/0-|delete path: $@=...pathList","file-merge,merge/AP/2-|merge to one file: $@=mergedFile,...inputFileList",'fetch,f//1-3|fetch "GET" uri: -O=outputFile/stdout, $@=initialUrl,jumpMax/4,timeout/0','process-status,ps//0-1|show system process status: -J=isOutputJSON, $0=outputMode/"pid--"',"json-format,jf/AI/0-1|re-format JSON file: -O=outputFile/-I, -I=inputFile, $0=unfoldLevel/2","server-serve-static,sss//0-1|static file server: -H=hostname:port, -R=staticRoot/cwd, $0=expireTime/5*1000","server-serve-static-simple,ssss//0-1|static file server, no HTML: -H=hostname:port, -R=staticRoot/cwd, $0=expireTime/5*1000","server-websocket-group,swg|websocket chat server: -H=hostname:port","server-test-connection,stc|connection test server: -H=hostname:port","server-tcp-proxy,stp//1-|tcp proxy server: -H=hostname:port, $@=toHostname:toPort,toHostname:toPort,...")
const i=s.map(({name:e})=>e)

@@ -6,0 +6,0 @@ exports.MODE_NAME_LIST=i

@@ -12,7 +12,7 @@ var e=require("../time")

p=(p+r.getUint8(s))%n}return(p%Math.pow(2,4*t)).toString(16).padStart(t,"0")}
const n=({tag:t=(0,e.getTimestamp)().toString(36),size:r=65536,tokenSize:a=8,timeGap:i=30})=>{if(!/^\w*$/.test(t))throw new Error(`invalid tag: ${t}`)
const n=({tag:t=(0,e.getTimestamp)().toString(36),size:r=65536,tokenSize:a=8,timeGap:i=30,info:o=null})=>{if(!/^\w*$/.test(t))throw new Error(`invalid tag: ${t}`)
if(!Number.isInteger(r)||r<=1024||r%32)throw new Error(`invalid size: ${r}`)
if(!Number.isInteger(a)||a>13||a<2)throw new Error(`invalid tokenSize: ${a}`)
if(!Number.isInteger(i)||i<1)throw new Error(`invalid timeGap: ${i}`)
return{tag:t,size:r,tokenSize:a,timeGap:i}}
return{tag:t,size:r,tokenSize:a,timeGap:i,info:o}}
exports.verifyOption=n

@@ -36,5 +36,5 @@ exports.verifyCheckCode=(t,r,a=(0,e.getTimestamp)())=>{if("string"!=typeof r||r.length<t.tokenSize)throw new Error(`invalid checkCode: ${r}`)

exports.parseCheckCode=c
exports.packDataArrayBuffer=({tag:e,size:t,tokenSize:r,timeGap:i,dataView:o})=>(0,a.packArrayBufferPacket)(JSON.stringify([e,t,r,i]),o.buffer)
exports.packDataArrayBuffer=({tag:e,size:t,tokenSize:r,timeGap:i,info:o,dataView:n})=>(0,a.packArrayBufferPacket)(JSON.stringify([e,t,r,i,o]),n.buffer)
exports.parseDataArrayBuffer=e=>{const[t,r]=(0,a.parseArrayBufferPacket)(e)
const[i,o,n,s]=JSON.parse(t)
return{tag:i,size:o,tokenSize:n,timeGap:s,dataView:new DataView(r)}}
const[i,o,n,s,p=null]=JSON.parse(t)
return{tag:i,size:o,tokenSize:n,timeGap:s,info:p,dataView:new DataView(r)}}

@@ -6,5 +6,5 @@ var e=require("stream")

r.pipe(e)})
exports.bufferToStream=r=>{const o=new e.Duplex
exports.bufferToReadableStream=r=>{const o=new e.Readable
o.push(r)
o.push(null)
return o}
exports.COMMON_LAYOUT=(t=[],e=[])=>["<!DOCTYPE html>","<html>","<head>",'<meta charset="utf-8">','<meta name="viewport" content="minimum-scale=1, width=device-width">',...t,"</head>","<body>",...e,"</body>","</html>"].join("\n")
exports.COMMON_STYLE=()=>"<style>\n*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; outline-color: #f00; }\n::-webkit-scrollbar-thumb { background: #0004; }\n::-webkit-scrollbar-thumb:hover { background: #0006; }\nbody { overflow: auto; display: flex; flex-flow: column; height: 100vh; font-family: monospace; font-size: 16px; }\nbutton, .button { text-decoration: none; cursor: pointer; margin: 4px; padding: 4px; min-width: 32px; border: 0; border-radius: 4px; background: hsla(0, 0%, 70%, 0.4); box-shadow: inset 0 0 0 1px #888; }\nbutton:hover, .button:hover { background: hsla(0, 0%, 80%, 0.4); box-shadow: inset 0 0 0 1px #aaa; }\nbutton.select, button:hover.select, .button.select, .button:hover.select { color: #e00; box-shadow: inset 0 0 0 1px #e00; }\nbutton:disabled, button:disabled:hover, .button:disabled, .button:disabled:hover { cursor: default; background: hsla(0, 0%, 100%, 0.4); box-shadow: unset; }\n@media (pointer: fine) {\n ::-webkit-scrollbar { width: 14px; height: 14px; }\n button, .button, .auto-height { min-height: 20px; font-size: 14px; } \n}\n@media (pointer: coarse) {\n ::-webkit-scrollbar { width: 6px; height: 6px; }\n button, .button, .auto-height { min-height: 32px; font-size: 18px; } \n}\n</style>"
exports.COMMON_STYLE=()=>"<style>\n*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; outline-color: #f00; }\n\n* { scrollbar-color: #888a #6664; scrollbar-width: thin; }\n::-webkit-scrollbar { width: 6px; height: 6px; }\n::-webkit-scrollbar-thumb { background: #8886; }\n::-webkit-scrollbar-thumb:hover { background: #888a; }\n\nbody { overflow: auto; display: flex; flex-flow: column; height: 100vh; font-family: monospace; font-size: 16px; }\n\nbutton, .button { text-decoration: none; cursor: pointer; margin: 4px; padding: 4px; min-width: 32px; border: 0; border-radius: 4px; background: hsla(0, 0%, 70%, 0.4); box-shadow: inset 0 0 0 1px #888; }\nbutton:hover, .button:hover { background: hsla(0, 0%, 80%, 0.4); box-shadow: inset 0 0 0 1px #aaa; }\nbutton.select, button:hover.select, .button.select, .button:hover.select { color: #e00; box-shadow: inset 0 0 0 1px #e00; }\nbutton:disabled, button:disabled:hover, .button:disabled, .button:disabled:hover { cursor: default; background: hsla(0, 0%, 100%, 0.4); box-shadow: unset; }\n@media (pointer: fine) { button, .button, .auto-height { min-height: 20px; font-size: 14px; } }\n@media (pointer: coarse) { button, .button, .auto-height { min-height: 32px; font-size: 18px; } }\n</style>"
exports.COMMON_SCRIPT=c=>{const d={}
const b=[]
Object.entries(Object.assign({qS:t,qSA:e,cE:n,aCL:o,mECN:i,mEA:r,iDR:s,tDR:a},c)).forEach(([t,e])=>{"function"==typeof e?b.push(`<script>window[${JSON.stringify(t)}] = ${e.toString()}<\/script>`):d[t]=e})
Object.entries(Object.assign({qS:t,qSA:e,cE:o,aCL:n,mECN:r,mEA:i,iDR:s,tDR:a},c)).forEach(([t,e])=>{"function"==typeof e?b.push(`<script>window[${JSON.stringify(t)}] = ${e.toString()}<\/script>`):d[t]=e})
return[`<script>Object.assign(window, ${JSON.stringify(d)})<\/script>`,...b].join("\n")}
const t=(t,e)=>{const n=document.querySelector(t)
n&&"string"==typeof e&&(n.innerHTML=e)
const t=(t,e)=>{const o=document.querySelector(t)
o&&"string"==typeof e&&(o.innerHTML=e)
return o}
const e=t=>[...document.querySelectorAll(t)]
const o=(t,e={},o=[])=>{const n=Object.assign(document.createElement(t),e)
o.forEach(t=>t&&n.appendChild(t))
return n}
const e=t=>[...document.querySelectorAll(t)]
const n=(t,e={},n=[])=>{const o=Object.assign(document.createElement(t),e)
n.forEach(t=>t&&o.appendChild(t))
return o}
const o=(t,e=[])=>e.forEach(e=>e&&t.appendChild(e))
const i=(t,e,...n)=>t.classList[e?"add":"remove"](...n)
const r=(t,e,n,o="")=>t[e?"setAttribute":"removeAttribute"](n,o)
const n=(t,e=[])=>e.forEach(e=>e&&t.appendChild(e))
const r=(t,e,...o)=>t.classList[e?"add":"remove"](...o)
const i=(t,e,o,n="")=>t[e?"setAttribute":"removeAttribute"](o,n)
const s=()=>"complete"===document.readyState

@@ -18,0 +18,0 @@ const a=t=>{if(window.iDR())return t()

@@ -17,3 +17,3 @@ import { getTimestamp } from "../time";

};
const verifyOption = ({tag = getTimestamp().toString(36), size = 65536, tokenSize = 8, timeGap = 30}) => {
const verifyOption = ({tag = getTimestamp().toString(36), size = 65536, tokenSize = 8, timeGap = 30, info = null}) => {
if (!/^\w*$/.test(tag)) throw new Error(`invalid tag: ${tag}`);

@@ -27,3 +27,4 @@ if (!Number.isInteger(size) || size <= 1024 || size % 32) throw new Error(`invalid size: ${size}`);

tokenSize,
timeGap
timeGap,
info
};

@@ -58,6 +59,6 @@ };

};
const packDataArrayBuffer = ({tag, size, tokenSize, timeGap, dataView}) => packArrayBufferPacket(JSON.stringify([ tag, size, tokenSize, timeGap ]), dataView.buffer);
const packDataArrayBuffer = ({tag, size, tokenSize, timeGap, info, dataView}) => packArrayBufferPacket(JSON.stringify([ tag, size, tokenSize, timeGap, info ]), dataView.buffer);
const parseDataArrayBuffer = dataArrayBuffer => {
const [headerString, payloadArrayBuffer] = parseArrayBufferPacket(dataArrayBuffer);
const [tag, size, tokenSize, timeGap] = JSON.parse(headerString);
const [tag, size, tokenSize, timeGap, info = null] = JSON.parse(headerString);
return {

@@ -68,2 +69,3 @@ tag,

timeGap,
info,
dataView: new DataView(payloadArrayBuffer)

@@ -70,0 +72,0 @@ };

@@ -1,2 +0,2 @@

import { Duplex } from "stream";
import { Readable } from "stream";
const pipeStreamAsync = (writableStream, readableStream) => new Promise((resolve, reject) => {

@@ -10,8 +10,8 @@ readableStream.on("error", reject);

});
const bufferToStream = buffer => {
const stream = new Duplex();
stream.push(buffer);
stream.push(null);
return stream;
const bufferToReadableStream = buffer => {
const readableStream = new Readable();
readableStream.push(buffer);
readableStream.push(null);
return readableStream;
};
export { pipeStreamAsync, bufferToStream };
export { pipeStreamAsync, bufferToReadableStream };
const COMMON_LAYOUT = (extraHeadList = [], extraBodyList = []) => [ "<!DOCTYPE html>", "<html>", "<head>", '<meta charset="utf-8">', '<meta name="viewport" content="minimum-scale=1, width=device-width">', ...extraHeadList, "</head>", "<body>", ...extraBodyList, "</body>", "</html>" ].join("\n");
const COMMON_STYLE = () => "<style>\n*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; outline-color: #f00; }\n::-webkit-scrollbar-thumb { background: #0004; }\n::-webkit-scrollbar-thumb:hover { background: #0006; }\nbody { overflow: auto; display: flex; flex-flow: column; height: 100vh; font-family: monospace; font-size: 16px; }\nbutton, .button { text-decoration: none; cursor: pointer; margin: 4px; padding: 4px; min-width: 32px; border: 0; border-radius: 4px; background: hsla(0, 0%, 70%, 0.4); box-shadow: inset 0 0 0 1px #888; }\nbutton:hover, .button:hover { background: hsla(0, 0%, 80%, 0.4); box-shadow: inset 0 0 0 1px #aaa; }\nbutton.select, button:hover.select, .button.select, .button:hover.select { color: #e00; box-shadow: inset 0 0 0 1px #e00; }\nbutton:disabled, button:disabled:hover, .button:disabled, .button:disabled:hover { cursor: default; background: hsla(0, 0%, 100%, 0.4); box-shadow: unset; }\n@media (pointer: fine) {\n ::-webkit-scrollbar { width: 14px; height: 14px; }\n button, .button, .auto-height { min-height: 20px; font-size: 14px; } \n}\n@media (pointer: coarse) {\n ::-webkit-scrollbar { width: 6px; height: 6px; }\n button, .button, .auto-height { min-height: 32px; font-size: 18px; } \n}\n</style>";
const COMMON_STYLE = () => "<style>\n*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; outline-color: #f00; }\n\n* { scrollbar-color: #888a #6664; scrollbar-width: thin; }\n::-webkit-scrollbar { width: 6px; height: 6px; }\n::-webkit-scrollbar-thumb { background: #8886; }\n::-webkit-scrollbar-thumb:hover { background: #888a; }\n\nbody { overflow: auto; display: flex; flex-flow: column; height: 100vh; font-family: monospace; font-size: 16px; }\n\nbutton, .button { text-decoration: none; cursor: pointer; margin: 4px; padding: 4px; min-width: 32px; border: 0; border-radius: 4px; background: hsla(0, 0%, 70%, 0.4); box-shadow: inset 0 0 0 1px #888; }\nbutton:hover, .button:hover { background: hsla(0, 0%, 80%, 0.4); box-shadow: inset 0 0 0 1px #aaa; }\nbutton.select, button:hover.select, .button.select, .button:hover.select { color: #e00; box-shadow: inset 0 0 0 1px #e00; }\nbutton:disabled, button:disabled:hover, .button:disabled, .button:disabled:hover { cursor: default; background: hsla(0, 0%, 100%, 0.4); box-shadow: unset; }\n@media (pointer: fine) { button, .button, .auto-height { min-height: 20px; font-size: 14px; } }\n@media (pointer: coarse) { button, .button, .auto-height { min-height: 32px; font-size: 18px; } }\n</style>";
const COMMON_SCRIPT = injectMap => {

@@ -4,0 +4,0 @@ const valueObject = {};

@@ -1,1 +0,1 @@

{"name":"dr-js","version":"0.22.3","description":"A collection of strange functions","author":"dr-js","license":"MIT","repository":"github:dr-js/dr-js","bin":"bin/index.js","browser":"library/Dr.browser.js","engines":{"node":">=10.16","npm":">=6.10"},"sideEffects":false}
{"name":"dr-js","version":"0.23.0-dev.0","description":"A collection of strange functions","author":"dr-js","license":"MIT","repository":"github:dr-js/dr-js","bin":"bin/index.js","browser":"library/Dr.browser.js","engines":{"node":">=10.16","npm":">=6.10"},"sideEffects":false}

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc