deleteFirstLine(){
        const read = Fs.createReadStream(this.filepath);
        const tempfile = this.filepath + ".tmp";
        const write = Fs.createWriteStream(tempfile);
        const transform = new FirstLineTransform();
        return new Promise((resolve, reject) => {
            read.pipe(transform)
                .pipe(write)  
                .on("error", (err) => {
                    reject(err);
                })
                .on("finish", async () => {
                    this.filesize -= transform.bytes_removed;
                    if(this.filesize < 0){
                        this.filesize = 0;
                    }
                    await this.end();
                    this.delete();
                    Fs.renameSync(tempfile, this.filepath);
                    this.open();
                    resolve();
                });
        });     
    }
/**
     * Delete the first line of the file
     * @returns {Promise}
     */
Delete the first line of the file
@returns {Promise}
Delete the first line of the file @returns { Promise }
deleteFirstLine(){
        const read = Fs.createReadStream(this.filepath);
        const tempfile = this.filepath + ".tmp";
        const write = Fs.createWriteStream(tempfile);
        const transform = new FirstLineTransform();
        return new Promise((resolve, reject) => {
            read.pipe(transform)
                .pipe(write)  
                .on("error", (err) => {
                    reject(err);
                })
                .on("finish", async () => {
                    this.filesize -= transform.bytes_removed;
                    if(this.filesize < 0){
                        this.filesize = 0;
                    }
                    await this.end();
                    this.delete();
                    Fs.renameSync(tempfile, this.filepath);
                    this.open();
                    resolve();
                });
        });     
    }
deleteFirstLine ( ) { const read = Fs . createReadStream ( this . filepath ) ; const tempfile = this . filepath + ".tmp" ; const write = Fs . createWriteStream ( tempfile ) ; const transform = new FirstLineTransform ( ) ; return new Promise ( ( resolve , reject ) => { read . pipe ( transform ) . pipe ( write ) . on ( "error" , ( err ) => { reject ( err ) ; } ) . on ( "finish" , async ( ) => { this . filesize -= transform . bytes_removed ; if ( this . filesize < 0 ) { this . filesize = 0 ; } await this . end ( ) ; this . delete ( ) ; Fs . renameSync ( tempfile , this . filepath ) ; this . open ( ) ; resolve ( ) ; } ) ; } ) ; }
Delete the first line of the file
 @returns {Promise}
Delete the first line of the file @returns { Promise }