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

knot

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knot

A client side Node experiment.

  • 0.0.9
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

Knot Node

Build Status

A programmatic folly exploring the underbelly of implementing a client-side version of Node.

Exmaple Usage

<script type="text/javascript" src="/knot/process.js"></script>
<script type="text/javascript">
    process(function(exports, require, module) {
        var util = require('util');
        console.log(util.inspect(this, true, 6));
    });
</script>

Supported Modules & Functions

Globals

  • process
  • console
  • require()
  • __filename
  • __dirname
  • module
  • exports
  • setTimeout(cb, ms)
  • clearTimeout(t)
  • setInterval(cb, ms)
  • clearInterval(t)

Process

  • process.stdout
  • process.stderr
  • process.execPath
  • process.cwd()
  • process.version
  • process.versions
  • process.installPrefix
  • process.arch
  • process.platform
  • process.uptime()

Console

  • console.log()
  • console.info()
  • console.warn()
  • console.error()
  • console.dir(obj)
  • console.time(label)
  • console.timeEnd(label)

Utils

  • util.format()
  • util.debug(string)
  • util.log(string)
  • util.inspect(object, [showHidden], [depth], [colors])
  • util.isArray(object)
  • util.isRegExp(object)
  • util.isDate(object)
  • util.isError(object)
  • (not tested) util.pump(readableStream, writableStream, [callback])
  • util.inherits(constructor, superConstructor)

Events

  • emitter.addListener(event, listener)
  • emitter.on(event, listener)
  • emitter.once(event, listener)
  • emitter.removeListener(event, listener)
  • emitter.removeAllListeners([event])
  • emitter.setMaxListeners(n)
  • emitter.listeners(event)
  • emitter.emit(event, [arg1], [arg2], [...])

Buffer

Notes: process.binding('buffer').SlowBuffer.

  • (check support) SlowBuffer

Path

  • path.normalize(p)
  • path.join([path1], [path2], [...])
  • path.resolve([from ...], to)
  • path.relative(from, to)
  • path.dirname(p)
  • path.basename(p, [ext])
  • path.extname(p)

URL

  • url.parse(urlStr, [parseQueryString], [slashesDenoteHost])
  • url.format(urlObj)
  • url.resolve(from, to)

Query Strings

Commented out "process.binding('http_parser').urlDecode" to make it work.

  • querystring.stringify(obj, [sep], [eq])
  • querystring.parse(str, [sep], [eq])
  • querystring.escape
  • (does not work) querystring.unescape

Assertion Testing

  • assert.fail(actual, expected, message, operator)
  • assert(value, message), assert.ok(value, [message])
  • assert.equal(actual, expected, [message])
  • assert.notEqual(actual, expected, [message])
  • (does not work) assert.deepEqual(actual, expected, [message])
  • (does not work) assert.notDeepEqual(actual, expected, [message])
  • assert.strictEqual(actual, expected, [message])
  • assert.notStrictEqual(actual, expected, [message])
  • assert.throws(block, [error], [message])
  • assert.doesNotThrow(block, [error], [message])
  • assert.ifError(value)

Modules Not Supported

  • Crypto
  • File System
  • Net
  • UDP/Datagram
  • DNS
  • Stream
  • HTTP
  • HTTPS
  • Readline
  • REPL
  • VM
  • Child Processes
  • TTY
  • ZLIB
  • OS
  • Debugger
  • Cluster

FAQs

Package last updated on 24 Jul 2012

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

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