Module de base

chemin du module_win32

Module de traitement du chemin de fichier

Méthode de référence :

1
var path = require('path').win32;

fonction statique

normalize

Standardisez le chemin et traitez le répertoire parent et d'autres informations dans le chemin

1
static String path_win32.normalize(String path);

Paramètres d'appel :

  • path: String, le chemin non traité donné

Résultats de retour :

  • String, renvoie le chemin traité

basename

Recherchez le nom du fichier dans le chemin. Si une extension est spécifiée, l'extension correspondante sera automatiquement annulée.

1 2
static String path_win32.basename(String path, String ext = "");

Paramètres d'appel :

  • path: String, le chemin de la requête donnée
  • ext: Chaîne, spécifie l'extension. S'il y a une extension qualifiée dans le nom du fichier, elle sera automatiquement annulée.

Résultats de retour :

  • String, renvoie le nom du fichier

extname

Interroger l'extension de fichier dans le chemin

1
static String path_win32.extname(String path);

Paramètres d'appel :

  • path: String, le chemin de la requête donnée

Résultats de retour :

  • String, renvoie l'extension obtenue

format

Essayez de formater un objet en tant que chemin

1
static String path_win32.format(Object pathObject);

Paramètres d'appel :

  • pathObject: Objet, spécifiez les paramètres

Résultats de retour :

  • String, renvoie le chemin formaté

Les champs pris en charge par pathObject sont les suivants :

1 2 3 4 5 6 7
{ "dir": "", // specify the directory of the path "root": "", // specify the root of the path "base": "", // specify the base of the path, it's the combination of name and ext "name": "", // specify the name of the path "ext": "", // specify the ext of the path }

parse

Analyser les chemins en objets chemin

1
static NObject path_win32.parse(String path);

Paramètres d'appel :

  • path: Chaîne, chemin

Résultats de retour :

  • NObject, renvoie l'objet pathObject

dirname

Chemin du répertoire dans le chemin de la requête

1
static String path_win32.dirname(String path);

Paramètres d'appel :

  • path: String, le chemin de la requête donnée

Résultats de retour :

  • String, renvoie le chemin d'accès au répertoire obtenu

fullpath

Convertir le chemin donné en chemin complet

1
static String path_win32.fullpath(String path);

Paramètres d'appel :

  • path: String, le chemin d'accès à la conversion donnée

Résultats de retour :

  • String, renvoie le chemin complet de la conversion

isAbsolute

Identifier si le chemin donné est un chemin absolu

1
static Boolean path_win32.isAbsolute(String path);

Paramètres d'appel :

  • path: String, étant donné le chemin à identifier

Résultats de retour :

  • Boolean, renvoie vrai s'il s'agit d'un chemin absolu.

join

Fusionner une série de chemins en un seul chemin

1
static String path_win32.join(...ps);

Paramètres d'appel :

  • ps: ..., un ou plusieurs chemins liés

Résultats de retour :

  • String, renvoie le nouveau chemin obtenu

resolve

Fusionner une série de chemins en un chemin absolu

1
static String path_win32.resolve(...ps);

Paramètres d'appel :

  • ps: ..., un ou plusieurs chemins liés

Résultats de retour :

  • String, renvoie le nouveau chemin obtenu

relative

Trouver le chemin relatif de _from à à

1 2
static String path_win32.relative(String _from, String to);

Paramètres d'appel :

  • _from: Chaîne, chemin source
  • to: Chaîne, chemin cible

Résultats de retour :

  • String, renvoie le chemin relatif obtenu

toNamespacedPath

Convertir en chemin préfixé par l'espace de noms. Uniquement valable sous Windows, les autres systèmes reviendront directement.

1
static Value path_win32.toNamespacedPath(Value path = undefined);

Paramètres d'appel :

  • path: Valeur, le chemin donné.

Résultats de retour :

  • Value, renvoie le nouveau chemin obtenu

voir : https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces

propriétés statiques

sep

Chaîne, interrogez le caractère de séparation de chemin du système d'exploitation actuel, posix renvoie '/', Windows renvoie '\'

1
static readonly String path_win32.sep;

delimiter

Chaîne, interrogez le caractère de combinaison multi-chemins du système d'exploitation actuel, posix renvoie ':', Windows renvoie ';'

1
static readonly String path_win32.delimiter;

posix

Objet, implémentation posix, voirpath_posix

1
static readonly Object path_win32.posix;

win32

Objet, implémentation Windows, voir path_win32

1
static readonly Object path_win32.win32;