Home Reference Source
import RecordBuilder from 'node-warc/lib/warcRecord/builder.js'
public class | source

RecordBuilder

Progressively builds warc records by consuming the file line by line

Constructor Summary

Public Constructor
public

Create a new RecordBuilder

Member Summary

Private Members
private
private

_parts: {header: Buffer[], c1: Buffer[], c2: Buffer[]}

Method Summary

Public Methods
public

Returns a new WARC record if one can be created otherwise returns null

public

Consumes a line of a WARC file.

Public Constructors

public constructor() source

Create a new RecordBuilder

Private Members

private _parsingState: * source

private _parts: {header: Buffer[], c1: Buffer[], c2: Buffer[]} source

Public Methods

public buildRecord(): WARCRecord source

Returns a new WARC record if one can be created otherwise returns null

Return:

WARCRecord (nullable: true)

public consumeLine(line: Buffer): WARCRecord source

Consumes a line of a WARC file. If a record can be built this function returns a new WARCRecord otherwise null

Params:

NameTypeAttributeDescription
line Buffer

The line to be consumed

Return:

WARCRecord (nullable: true)