npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ftp-response-parser

v1.0.1

Published

Parser for FTP server responses

Downloads

1,218,113

Readme

ftp-response-parser

This module provides a fast, lightweight streaming parser for FTP response format strings.

Given a string like this:

211-Features supported:\n
 EPRT\n
 EPSV\n
 MDTM\n
 MLST type*;perm*;size*;modify*;unique*;unix.mode;unix.uid;unix.gid;\n
 REST STREAM\n
 SIZE\n
 TVFS\n
 UTF8\n
211 End FEAT.\n
215 UNIX Type: L8\n
331 Username ok, send password.\n
230 Login successful.\n
200 Type set to: Binary.\n
250 "/test" is the current directory.\n

it will stream the following objects:

{
  code: 211,
  text: '211-Features supported:\n EPRT\n EPSV\n MDTM\n MLST type*;perm*;size*;modify*;unique*;unix.mode;unix.uid;unix.gid;\n REST STREAM\n SIZE\n TVFS\n UTF8\n211 End FEAT.',
  isMark: false,
  isError: false
}
{
  code: 215,
  text: '215 UNIX Type: L8',
  isMark: false,
  isError: false
}
{
  code: 331,
  text: '331 Username ok, send password.',
  isMark: false,
  isError: false
}
{
  code: 230,
  text: '230 Login successful.',
  isMark: false,
  isError: false
}
{
  code: 200,
  text: '200 Type set to: Binary.',
  isMark: false,
  isError: false
}
{
  code: 250,
  text: '250 "/test" is the current directory.',
  isMark: false,
  isError: false
}

Usage


var ResponseParser = require('ftp-response-parser');

var myParser = new ResponseParser();

myParser.on('readable', function() {
  var line;
  while (line = myParser.read()) {
    console.log(line.code); // will emit 215
  }
});

myParser.write('215 UNIX Type: L8');

Install

To get the module, with npm do:

npm install ftp-response-parser

Test

With npm do:

npm test

License

MIT