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.
xform-to-json
Advanced tools
Converts XForm submissions from ODK Collect to json or geojson.
var xform2json = require('xform-to-json');
xform2json(xmlString, function(err, json) {
console.log(json);
})
xform2json(xmlString, [options], callback)
ODK sends an xml file with a single root node, which is discarded.
By default the following metadata is created in the json output:
form.meta = {
instanceId: form.meta.instanceID || 'uuid:' + uuid.v1(),
instanceName: form.meta.instanceName || formKey,
formId: form.$.id,
version: form.$.version
};
Where:
form.meta
is the original meta data from the ODK xml submission
formKey
is the name of the original xml root node
form.$.id
and form.$.version
are the two attributes on the root node from ODK xml.
options.geojson
When set to true will output geojson, using a geopoint field from the xml for the coordinates if present. If more than one geopoint field is present, the field is chosen arbitrarily unless options.locationField
is set (see below). If no geopoint / location field is found then geojson geometry is null
.
options.locationField
The fieldname to use for the geojson coordinates.
options.meta
Pass a hash of any metadata values to add to the form, e.g. meta.submissionTime
.
FAQs
Translate an XForm XML string to JSON.
The npm package xform-to-json receives a total of 5 weekly downloads. As such, xform-to-json popularity was classified as not popular.
We found that xform-to-json demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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.