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.
@jynnantonnyx/nest-csv-parser
Advanced tools
CSV parser for NestJS framework (forked from original nest-csv-parser)
Nest framework library.
Wrapper for csv-parser library
This project is a fork of the original nest-csv-parser.
Additions in this version:
ParsedData.headers
field)$ npm install @jynnantonnyx/nest-csv-parser
# or if you using Yarn
$ yarn add @jynnantonnyx/nest-csv-parser
Add @jynnantonnyx/nest-csv-parser
as a dependency.
import { Module } from '@nestjs/common'
import { CsvModule } from '@jynnantonnyx/nest-csv-parser'
// ...imports of your app dependecies
@Module({
imports: [
CsvModule, // <-- add into imports
...
],
controllers: [ ... ],
providers: [ ... ]
})
export class AppModule {}
Parser will create instance of entity for each line in CSV stream.
// app.parser.ts
import { Injectable } from '@nestjs/common'
import { CsvParser } from '@jynnantonnyx/nest-csv-parser'
class Entity {
foo: string
bar: string
}
@Injectable()
export class AppService {
constructor(
private readonly csvParser: CsvParser
) {}
async parse() {
// Create stream from file (or get it from S3)
const stream = fs.createReadStream(__dirname + '/some.csv');
const data: ParsedData<Entitiy> data = await csvParser.parse(stream, Entity);
const entities: Entity[] = data.list;
// Inspect headers
const headers: string[] = data.headers;
return entities;
}
}
csvParser.parse(stream, Entity, count, offset, csvConfig)
has 5 parameters.
required
First parameter has to be the stream of the CSV file. NodeJS Reference
required
Has to be object from which will parser create instance.
default: null
How many lines you want to parse.
default: null
Offset is similar to SQL databases. Skips the N lines from the beginning of the file.
default
{ strict: true, separator: ';' }
Just a configuration object for csv-parser library options you can find here
# clone repository
$ git clone git@github.com:jynnantonnyx/nest-csv-parser.git
$ cd nest-csv-parser
# install dependencies
$ npm install
# watch mode
$ npm test:watch
# unit tests
$ npm test
FAQs
CSV parser for NestJS framework (forked from original nest-csv-parser)
The npm package @jynnantonnyx/nest-csv-parser receives a total of 10 weekly downloads. As such, @jynnantonnyx/nest-csv-parser popularity was classified as not popular.
We found that @jynnantonnyx/nest-csv-parser 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.