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

map-files

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

map-files - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

8

.verbrc.md

@@ -28,2 +28,10 @@ # {%= name %} {%= badge("fury") %}

### options.cwd
Define the current working directory
```js
files('*.txt', {cwd: 'templates'});
```
### options.name

@@ -30,0 +38,0 @@

3

index.js

@@ -9,2 +9,3 @@ 'use strict';

var path = require('path');
var relative = require('relative');
var glob = require('globby');

@@ -24,4 +25,6 @@

var files = glob.sync(patterns, options);
var cwd = options && options.cwd || process.cwd();
return files.reduce(function (cache, filepath) {
filepath = relative(path.resolve(cwd, filepath));
var key = name(filepath, options);

@@ -28,0 +31,0 @@ var str = read(filepath, options);

7

package.json
{
"name": "map-files",
"description": "Return an object for a glob of files. Pass a `rename` function for the keys, or a `parse` function for the content, allowing it to be used for readable or require-able files.",
"version": "0.2.0",
"version": "0.2.1",
"homepage": "https://github.com/jonschlinkert/map-files",

@@ -31,3 +31,4 @@ "author": {

"dependencies": {
"globby": "^0.1.1"
"globby": "^0.1.1",
"relative": "^0.1.6"
},

@@ -39,3 +40,3 @@ "devDependencies": {

"verb": ">= 0.2.6",
"verb-tag-jscomments": ">= 0.2.0"
"verb-tag-jscomments": "^0.2.2"
},

@@ -42,0 +43,0 @@ "keywords": [

@@ -33,2 +33,10 @@ # map-files [![NPM version](https://badge.fury.io/js/map-files.svg)](http://badge.fury.io/js/map-files)

### options.cwd
Define the current working directory
```js
files('*.txt', {cwd: 'templates'});
```
### options.name

@@ -85,4 +93,4 @@

_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 10, 2014._
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 16, 2014._
[globby]: https://github.com/sindresorhus/globby

@@ -33,2 +33,15 @@ /*!

it('should use a cwd.', function () {
var cache = files('*.txt', {cwd: 'test/fixtures'});
cache.should.have.property('a');
cache.should.have.property('b');
cache.should.have.property('c');
cache.should.eql({
a: { content: 'AAA', path: 'test/fixtures/a.txt' },
b: { content: 'BBB', path: 'test/fixtures/b.txt' },
c: { content: 'CCC', path: 'test/fixtures/c.txt' }
});
});
it('should rename the key with a custom function.', function () {

@@ -35,0 +48,0 @@ var cache = files('test/fixtures/*.txt', {

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