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

ls-fs

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ls-fs - npm Package Compare versions

Comparing version 1.1.3 to 1.2.0

lib/read-ini.js

32

gulpfile.js

@@ -9,4 +9,7 @@ 'use strict';

mergeStream = require('merge-stream'),
lsConfigs = require('ls-default-configs');
lsGulpTasks = require('lvsf-gulp-tasks'),
dirsToLint = ['./*.js', 'lib/**/*.js'],
testDirsToLint = ['test/*.js'];
gulp.task('default', _.noop);

@@ -18,27 +21,6 @@

gulp.task('mocha', function() {
return gulp.src(['test/*.js'], {read: false})
.pipe(mocha());
});
gulp.task('lint', lsGulpTasks.lint(dirsToLint, testDirsToLint));
gulp.task('lint', function() {
var jshintTestConfig = _.safeMerge(lsConfigs.jshintrc, {
globals: {
describe: true,
it: true
}
}),
jscsLint = gulp.src(['lib/**/*.js', 'test/**/*.js', './*.js'])
.pipe(jscs(lsConfigs.jscsrc)),
testLint = gulp.src(['test/*.js'])
.pipe(jshint(jshintTestConfig))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail')),
gulp.task('stylecheck', lsGulpTasks.checkstyle(dirsToLint.concat(testDirsToLint)));
otherLint = gulp.src(['./*.js', 'lib/*.js'])
.pipe(jshint(lsConfigs.jshintrc))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'));
return mergeStream(testLint, otherLint, jscsLint);
});
gulp.task('mocha', ['lint', 'stylecheck'], lsGulpTasks.mocha(['test/**/*.test.js']));

@@ -7,4 +7,6 @@ 'use strict';

requireDir: require('./require-dir'),
readIni: require('./read-ini'),
readJson: require('./read-json'),
writeIni: require('./write-ini'),
writeJson: require('./write-json')
});
{
"name": "ls-fs",
"version": "1.1.3",
"version": "1.2.0",
"description": "Some file utilities",

@@ -19,2 +19,3 @@ "main": "lib/ls-fs.js",

"chai": "^1.10.0",
"chai-as-promised": "^4.2.0",
"gulp": "^3.8.10",

@@ -26,8 +27,12 @@ "gulp-jscs": "^1.3.1",

"ls-default-configs": "^2.0.0",
"lvsf-gulp-tasks": "^1.1.0",
"merge-stream": "^0.1.6",
"mocha": "^2.0.1"
"mocha": "^2.0.1",
"sinon": "^1.12.2",
"sinon-chai": "^2.7.0"
},
"dependencies": {
"callsite": "^1.0.0",
"ls-lodash": "^1.0.0",
"ini": "^1.3.3",
"ls-lodash": "^2.0.0",
"q": "^1.1.2",

@@ -34,0 +39,0 @@ "q-io": "^1.11.6",

@@ -47,2 +47,31 @@ # ls-fs [![Build Status](https://travis-ci.org/LiveSafe/ls-fs.svg?branch=master)](https://travis-ci.org/LiveSafe/ls-fs)

### readIni
```js
lsFs.readIni(path, [opts]).then(function(parsedIniObj) {
console.log(parsedIniObj);
});
```
###### Arguments
1. `path` _(String)_ The path to the INI file to read
1. `[opts]` _(Object)_ Identical to `q-io/fs.read ` options
### writeIni
```js
lsFs.writeIni(path, obj, [opts]).then(function(pathToIni) {
console.log('wrote ' + pathToIni);
});
```
###### Arguments
1. `path` _(String)_ The path to the INI file to write
1. `obj` _(*)_ The thing to stringify into INI format
1. `opts` _(Object)_ Merge of options for `ini` and `q-io/fs.write`
### tmpDir

@@ -49,0 +78,0 @@

@@ -5,3 +5,3 @@ 'use strict';

path = require('path'),
expect = require('chai').expect,
expect = require('./test-helper').expect,
fs = require('fs'),

@@ -16,3 +16,3 @@ qFs = require('q-io/fs'),

return lsFs.readJson(jsonPath).then(function(fixtureObj) {
expect(fixtureObj).to.deep.equal({
return expect(fixtureObj).to.deep.equal({
foo: 'bar',

@@ -50,3 +50,3 @@ bar: {

.then(function(readObj) {
expect(readObj).to.deep.equal(newObj);
return expect(readObj).to.deep.equal(newObj);
})

@@ -63,3 +63,3 @@ .then(_.constant(jsonPath));

return qFs.isDirectory(tmpDirPath).then(function(isDir) {
expect(isDir).to.be.true();
return expect(isDir).to.be.true;
});

@@ -66,0 +66,0 @@ });

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