vinyl-named-with-path

Give vinyl files chunk path & names.

Usage no npm install needed!

<script type="module">
  import vinylNamedWithPath from 'https://cdn.skypack.dev/vinyl-named-with-path';
</script>

README

vinyl-named-with-path

Give vinyl files chunk path & names.

(Only name without dir: https://github.com/shama/vinyl-named)

example

var named = require('vinyl-named-with-path')
var fs = require('vinyl-fs')
var through = require('through')

fs.src('src/*.js')
  .pipe(named())
  .pipe(through(function(file) {
    // file.named now equals the relative name minus the extension
  }))

// Or return a name for a given file
fs.src('src/*.js')
  .pipe(named(function(file) {
    return 'your own name'
  }))

// Or specify a custom name property
fs.src('src/*.js')
  .pipe(named(function(file) {
    file.customName = 'your name'
    this.queue(file)
  }))

install

With npm do:

npm install vinyl-named-with-path

release history

  • 1.0.0 - initial release

license

Copyright (c) 2014 Bob Licensed under the MIT license.