dirname.js 322 B

1234567891011121314151617
  1. var utils = require('../utils')
  2. , path = require('path');
  3. /**
  4. * Return the dirname of `path`.
  5. *
  6. * @param {String} path
  7. * @return {String}
  8. * @api public
  9. */
  10. function dirname(p){
  11. utils.assertString(p, 'path');
  12. return path.dirname(p.val).replace(/\\/g, '/');
  13. };
  14. dirname.params = ['p'];
  15. module.exports = dirname;