Skip to content

Instantly share code, notes, and snippets.

@hparra
Last active December 24, 2015 06:29
Show Gist options
  • Select an option

  • Save hparra/6757826 to your computer and use it in GitHub Desktop.

Select an option

Save hparra/6757826 to your computer and use it in GitHub Desktop.
Path Nomenclature a la Node

Path Nomenclature a la Node

The following is path nomenclature inferred by the node.js library:

  • path: /path/to/your/file.txt
  • dirname: /path/to/your/
  • basename: file.txt
  • extname txt

When writing code for node, it is preferable to use these terms for variables, etc.

Confusion

Confusion arises with terms. Some people believe the path(name) only refers to the dir(ectory) name, when in fact a legal path may or may not contain the basename of a file. When it does, it may also be known as the filename.

Sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment