Chemin du module_win32
Module de traitement de chemin de fichier
Méthode de référence :
1var path = require('path').win32;
Fonction statique
normalize
Standardiser le chemin, traiter les informations telles que le répertoire parent dans le chemin
1static String path_win32.normalize(String path);
Paramètres d'appel :
- path: String, le chemin non traité donné
Résultat de retour :
- String, Renvoie le chemin traité
basename
Interrogez le nom du fichier dans le chemin, si l'extension est spécifiée, l'extension correspondante sera automatiquement annulée
1
2static String path_win32.basename(String path,
String ext = "");
Paramètres d'appel :
- path: String, le chemin de la requête donnée
- ext: String, spécifiez l'extension, s'il y a une extension qualifiée dans le nom du fichier, elle sera automatiquement annulée
Résultat de retour :
- String, Renvoie le nom du fichier
extname
Interroger l'extension de fichier dans le chemin
1static String path_win32.extname(String path);
Paramètres d'appel :
- path: String, le chemin de la requête donnée
Résultat de retour :
- String, Renvoie l'extension obtenue
format
Essayez de formater un objet en tant que chemin
1static String path_win32.format(Object pathObject);
Paramètres d'appel :
- pathObject: Objet, spécifiez les paramètres
Résultat 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": "", // 指定路径的目录
"root": "", // 指定路径的根目录
"base": "", // 指定路径的文件名,等同于 ${name}.${ext}
"name": "", // 指定路径的主文件名
"ext": "", // 指定路径的扩展名
}
parse
Résoudre le chemin vers l'objet chemin
1static NObject path_win32.parse(String path);
Paramètres d'appel :
- path: chaîne, chemin
Résultat de retour :
- NObject, Renvoie l'objet pathObject
dirname
Chemin du répertoire dans le chemin de la requête
1static String path_win32.dirname(String path);
Paramètres d'appel :
- path: String, le chemin de la requête donnée
Résultat de retour :
- String, Retourne le chemin du répertoire obtenu
fullpath
Convertir le chemin donné en chemin complet
1static String path_win32.fullpath(String path);
Paramètres d'appel :
- path: String, le chemin de la conversion donnée
Résultat de retour :
- String, Renvoie le chemin complet de la conversion
isAbsolute
Identifier si le chemin donné est un chemin absolu
1static Boolean path_win32.isAbsolute(String path);
Paramètres d'appel :
- path: String, étant donné le chemin qui doit être reconnu
Résultat de retour :
- Boolean, Renvoie true s'il s'agit d'un chemin absolu
join
Combinez une série de chemins en un seul chemin
1static String path_win32.join(...ps);
Paramètres d'appel :
- ps: ..., un ou plusieurs chemins associés
Résultat de retour :
- String, Retourne le nouveau chemin
resolve
Combiner une série de chemins en un chemin absolu
1static String path_win32.resolve(...ps);
Paramètres d'appel :
- ps: ..., un ou plusieurs chemins associés
Résultat de retour :
- String, Retourne le nouveau chemin
relative
Trouver le chemin relatif de _de à à
1
2static String path_win32.relative(String _from,
String to);
Paramètres d'appel :
- _from: chaîne, chemin source
- to: chaîne, chemin cible
Résultat de retour :
- String, Renvoie le chemin relatif
toNamespacedPath
Converti en un chemin avec préfixe d'espace de noms. Uniquement valable dans Windows, les autres systèmes renvoient directement.
1static Value path_win32.toNamespacedPath(Value path = undefined);
Paramètres d'appel :
- path: Valeur, le chemin donné.
Résultat de retour :
- Value, Retourne le nouveau chemin
voir : https://msdn.microsoft.com/library/windows/desktop/aa365247(v=vs.85).aspx#namespaces
Propriétés statiques
sep
Chaîne, interroge le caractère de division du chemin du système d'exploitation actuel, posix renvoie '/', windows renvoie '\'
1static readonly String path_win32.sep;
delimiter
String, interroge les caractères de combinaison multi-chemins du système d'exploitation actuel, posix renvoie ':', windows renvoie ';'
1static readonly String path_win32.delimiter;
posix
Objet, implémentation posix, voir path_posix
1static readonly Object path_win32.posix;
win32
Objet, implémentation Windows, voir path_win32
1static readonly Object path_win32.win32;