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.
Read and write .dbf (dBase III) files in Node.js:
C
(string) , N
(numeric) , L
(logical) and D
(date) field typesnpm install dbffile
var DBFFile = require('dbffile');
DBFFile.open('[full path to .dbf file]')
.then(dbf => {
console.log(`DBF file contains ${dbf.recordCount} rows.`);
console.log(`Field names: ${dbf.fields.map(f => f.name)}`);
return dbf.readRecords(100);
})
.then(rows => rows.forEach(row => console.log(row)))
.catch(err => console.log('An error occurred: ' + err));
var DBFFile = require('dbffile');
var fieldDescriptors = [
{ name: 'fname', type: 'C', size: 255 },
{ name: 'lname', type: 'C', size: 255 }
];
var rows = [
{ fname: 'Joe', lname: 'Bloggs' },
{ fname: 'Mary', lname: 'Smith' }
];
DBFFile.create('[full path to .dbf file]', fieldDescriptors)
.then(dbf => {
console.log('DBF file created.');
return dbf.append(rows);
})
.then(() => console.log(rows.length + ' rows added.'))
.catch(err => console.log('An error occurred: ' + err));
The module exports two functions and a class, as follows:
/** Open an existing DBF file. */
function open(path: string): Promise<DBFFile>;
/** Create a new DBF file with no records. */
function create(path: string, fields: Field[]): Promise<DBFFile>;
/** Represents a DBF file. */
class DBFFile {
/** Full path to the DBF file. */
path: string;
/** Total number of records in the DBF file (NB: includes deleted records). */
recordCount: number;
/** Metadata for all fields defined in the DBF file. */
fields: { name: string; type: string; size: number; decs: number; }[];
/** Append the specified records to this DBF file. */
append(records: any[]): Promise<DBFFile>;
/** read some specific rows from the dbf file. **/
readRecords(maxRows?: number): Promise<any[]>;
}
FAQs
Read and write .dbf (dBase III & Visual FoxPro) files in Node.js
The npm package dbffile receives a total of 2,338 weekly downloads. As such, dbffile popularity was classified as popular.
We found that dbffile demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.