
Product
Introducing Socket MCP for Claude Desktop
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
A minimalist, functional utility library designed for embedding into another small program.
u.js
is a minimalist, functional utility library designed for embedding into another small program.
reduce
, map
)future.js
for the most important JS features
missing from older browsers (e.g., Array.map()
, Object.keys()
)That's it.1 u.js
has no dependencies and works in
any browser. The code has seen extensive production use, but the tests were part of a bigger
project and have not yet been ported.
u.js
is ideal for building a bootstrapper. Several of my projects have been embeddable tools.
When your code is going to run in hostile territory, versioning is especially important, but it
requires some way to get your versioned code on the page in the first place: a bootstrapper.
A tiny bootstrapper gives your users the flexibility to choose a version, but gives you the power to smooth over implementation assumptions (like changing configuration parameters, embedding-code, or the inevitable bug pasted onto someone's page). So I needed something tiny primarily to parse querystring values and work with collections. It had to come prior to the main program, as the program version could be overriden by configuration!
As Array.prototype.reduce()
, but for both Object and Arrays.
Invokes acc = fn.call(cxt, acc, v, k, o)
for each value in the collection, returning the final
value of the accumulator. For Arrays, k
will be the index.
As Array.prototype.map()
, but for both Object and Arrays.
Invokes fn.call(cxt, v, k, o)
for each value in the collection, returning a new collection with
the mapped values. (The collection will be an Object or Array based on the type of the input
collection.)
Copies all keys from each donor
onto the target
object, and then returns it.
Stub for Function.prototype.bind()
: returns a function (...more_args)
that when invoked,
calls the original function with the supplied context and arguments from both invocations
concatenated together:
fn.apply( context, args.concat(more_args) )
Returns whether the input object is an Array; calls Array.isArray(o)
if it exists, and a polyfill
otherwise.
Returns the string with leading and trailing whitespace removed.
Serializes an object into a string of "form-encoded" key-value pairs, applying one layer of URL-encoding.
Deserializes "form-encoded" key-value pairs (removing one layer of URL-encoding), and returning an object of their values. Note that repeated values in the serialized string will clobber each other.
Sets a cookie, returning an updated map from cookie key to value.
By default, the cookie will be set for all paths on the current domain using the current document, expiring on a distant date:
'Sun, 24-Mar-2024 11:11:11 GMT'
'/'
doc.domain
window.document
Open a ticket at github, or send me email.
[1]: u.js
does not provide any DOM manipulation; check out Zepto.js if you
need to fiddle with DOM elements.
FAQs
A minimalist, functional utility library designed for embedding into another small program.
The npm package u receives a total of 286 weekly downloads. As such, u popularity was classified as not popular.
We found that u 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.
Product
Add secure dependency scanning to Claude Desktop with Socket MCP, a one-click extension that keeps your coding conversations safe from malicious packages.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.