Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

netrc

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netrc - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

test/fixtures/netrc-valid-w-comment

5

index.js

@@ -43,2 +43,7 @@ /**

//if first index in array is empty string, strip it off (happens when first line of file is comment. Breaks the parsing)
if (tokens[0] === "") {
tokens.shift();
}
for(var i = 0; i < tokens.length; i+=2) {

@@ -45,0 +50,0 @@ var key = tokens[i]

2

package.json
{
"name": "netrc",
"version": "0.1.0",
"version": "0.1.1",
"description": "Parse netrc files",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -9,3 +9,4 @@ /**

var valid = fs.readFileSync(__dirname+"/fixtures/netrc-valid", "utf-8")
, invalid = fs.readFileSync(__dirname+"/fixtures/netrc-invalid", "utf-8");
, invalid = fs.readFileSync(__dirname+"/fixtures/netrc-invalid", "utf-8")
, validWithComment = fs.readFileSync(__dirname+"/fixtures/netrc-valid-w-comment", "utf-8");

@@ -25,2 +26,12 @@ describe("netrc", function() {

it("should parse a valid file with comments", function() {
var machines = netrc(__dirname+"/fixtures/netrc-valid-w-comment");
should.exist(machines);
machines.should.have.property("github.com");
machines["github.com"].should.have.property("login");
machines["github.com"].login.should.eql("CamShaft");
machines["github.com"].should.have.property("password");
machines["github.com"].password.should.eql("123");
});
it("should not parse an invalid string", function() {

@@ -44,2 +55,12 @@ var machines = netrc(__dirname+"/fixtures/netrc-invalid");

it("should parse a valid string (pulled from file with comments)", function() {
var machines = netrc.parse(validWithComment);
should.exist(machines);
machines.should.have.property("github.com");
machines["github.com"].should.have.property("login");
machines["github.com"].login.should.eql("CamShaft");
machines["github.com"].should.have.property("password");
machines["github.com"].password.should.eql("123");
});
it("should not parse an invalid string", function() {

@@ -46,0 +67,0 @@ var machines = netrc.parse(invalid);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc