Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
sdf-parser
Advanced tools
Allow to parse a SDF file and convert it to an array of objects.
npm install sdf-parser
In node script:
// allows to parse a file test.sdf that would be present in the same directory
var { parse } = require('sdf-parser');
var fs = require('fs');
var sdf = fs.readFileSync('./test.sdf', 'utf-8');
var result = parse(sdf);
console.log(result);
options:
var result = parse(sdf, {
exclude: ['Number of H-Donors'],
include: ['Number of H-Donors', 'CLogP', 'Code'],
modifiers: {
CLogP: function (field) {
return {
low: field * 1 - 0.2,
high: field * 1 + 0.2,
};
},
},
filter: (entry) => {
return entry.CLogP && entry.CLogP.low > 4;
},
});
This API is only available on Node.js.
Transform an input text stream to a stream of molecule objects.
fullResult
: true to emit the full result of parse
instead of just the molecules.parse
function.const { stream } = require('sdf-parser');
fs.createReadStream('test.sdf')
.pipe(stream.molecules())
.on('data', (molecule) => {
console.log(molecule.molfile);
});
Transform an input text stream to a stream of sdf entries.
const { stream } = require('sdf-parser');
fs.createReadStream('test.sdf')
.pipe(stream.entries())
.on('data', (entry) => {
// sdf entry as a string
});
FAQs
SDF parser
We found that sdf-parser demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.