Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
The DOM changes. You can capture those changes and sync multiple documents in real-time using this library to transform the changes for automagic conflict resolution. Sounds awesome? It is. To learn more about operational transformation, go to wikipedia or check out this guide to textual ot.
npm install dom-ot
The object you get from require('dom-ot')
is a full-featured shareJS ottype. This allows you to use dom-ot together with shareJS or the more unixy gulf. The shareJS interface will deal only with edits. An edit is essentially an array of operations.
This operation allows you to move a node from one path to another. Set fromPath
to null to insert a node into the tree (which should be passed as serializedNode
, serialized with vdom-serialize).
Set toPath
to null, to remove a node from the tree.
This operation allows you to set an attribute named attribute
of a given node at path
to a specific value
. Omit value to remove the attribute.
This operation allows you to modify the nodeValue
of a text node, by specifying a diff (which should be a packed changeset).
Transforms this operation in-place against another one, so that it assumes the changes of the other one have already happened. Use left
to break ties.
Apply an operation on a document, specified by rootNode
. Optionally, you may set index
to true
, to automatically index nodes for importing MutationSummaries (see the mutationSummary adapter).
Usually you will not create these operations by hand: Fortunately there's a handy adapter that will turn MutationObserver summaries into dom-ot edits. Currently there's only an import method available that allows you to convert mutation summaries into dom-ot edits, but not the other way around. I simply couldn't find a use case for that, so that's it.
summary
is a summary object as returned by MutationSummaryrootNode
is the rootNode that was observed
Before installing a MutationObserver with MutationSummary and importing the changes with this function, you will need to run an indexing function on the rootNode, so that the adapter can figure out where the nodes were before. Also, you need to continuously index newly inserted or moved nodes. You can set the optional index
param of <Operation>#apply
to true
, to do this automatically and efficiently.Creates an index for all children of rootNode which is necessary for import()
to work.
Run browserify test/tests.js > bundle.js
, then open test/index.html
in the browser of your choice.
(c) 2015 by Marcel Klehr
Licensed under the terms of the LGPL. See LICENSE.txt
in the root directory of this project.
FAQs
Operational transform library for DOM operations (conforms to shareJS' spec)
The npm package dom-ot receives a total of 3 weekly downloads. As such, dom-ot popularity was classified as not popular.
We found that dom-ot 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.