Skip to content

Path.format doesn't concat .name and .ext #6437

@eight04

Description

@eight04
  • Version: v4.4.3
  • Platform: Windows 7 64-bit
  • Subsystem: path

https://nodejs.org/docs/v4.4.3/api/path.html#path_path_format_pathobject

Under path.format, the document said that:

If the base property is not supplied, a concatenation of the name property and the ext property will be used as the base property.

However, This feature seems not working properly. With following code:

var path = require("path");

var file = path.format({
    root : "C:\\",
    dir : "C:\\path\\dir",
    ext : ".txt",
    name : "file"
});

console.log(file);

I always get:

C:\path\dir\

Metadata

Metadata

Assignees

No one assigned

    Labels

    pathIssues and PRs related to the path subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions