17.1.1 • Published 2 months ago

@wixc3/fs-utils v17.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

npm version @wixc3/fs-utils on Github

Home > @wixc3/fs-utils

fs-utils package

Functions

FunctionDescription
addRelativePrefix(path)
backSlash(str, type)Ensure a single heading/trailing backslash (/) of a single line string
createImportPath({ importedFilePath, targetFilePath, targetPackageJsonPath, fs, })Returns relative import path if imported and target files are in the same package, otherwise returns a bare import specifier.
formatToOSpaths(str)
getBareImportSpecifier(absoluteImportPath, packageJsonPath, packageJsonName)Creates bare import specifier for an absolute import path, stripping extension from JS/TS files.
getDTSPath(filePath)
getFullExtname(filePath)Returns file extension from the first occurrence of the ".", unlike path.extname() which returns from the last occurrence.
getImportPath(filePath)
getPackageJsonPath(filePath, fs)Gets path to package.json file closest to the given file path.
getPackageName(dirPath, fs)Gets package name.
getPackagePath(filePath, fs)Gets path to package directory, closest to the given file path.
getRelativeImportPath(sourceFilePath, filePathToImport)Creates relative import path for a file, stripping extension from JS/TS files.
getRelativeModulePath(sourceAbsFilePath, targetAbsFilePath)
isDirPath(filePath)
isJavaScriptFile(filePath)
isJsonFile(filePath)
isPathIncludesDir(filePath, directoryName)Safely checks if a path contains a directory name.
isRelativeModulePath(path)
isRelativeModuleRequest(request)
isSubPath(path, basePath, fs)Checks if a path is equal to or subpath of a given base path.
isTsOrJS(filePath)
isTypeAffectingFileOrDir(filePath)
isTypeScriptFile(filePath)
isWindowsStyleAbsolutePath(fsPath)
pathChainToRoot(currentPath)
pathToTrueCase(fs, path)Returns case-exact absolute form of the path, similar to fs.realpathSync.native() Trailing segments of the path that don't exist are left unchanged.
readPackageJson(dirPath, fs)Read and parse a directory's package.json
rebaseRelativeModulePath(filePath, modulePath)
replaceWinSlashes(str)

Interfaces

InterfaceDescription
AdjustRelativeImportPathArgs
CreateImportPathArgs

Variables

VariableDescription
fileRequestPrefixprefix for file requests in Language server protocol
17.1.1

2 months ago

17.0.0

2 months ago

16.3.0

2 months ago

16.2.1

2 months ago

16.2.0

3 months ago

16.1.3

4 months ago

16.1.0

4 months ago

16.0.0

4 months ago

15.1.1

5 months ago

15.1.0

5 months ago

15.0.0

5 months ago

14.0.0

5 months ago

14.1.0

5 months ago

13.4.0

6 months ago

13.3.2

8 months ago

13.2.0

10 months ago

13.3.0

9 months ago

13.0.0

10 months ago

13.1.0

10 months ago

13.0.1

10 months ago

12.0.3

11 months ago

12.0.4

11 months ago

12.1.0

10 months ago

12.0.1

11 months ago

11.1.1

11 months ago

11.1.0

11 months ago

11.0.0

11 months ago

10.0.0

11 months ago

8.2.1

12 months ago

9.0.0

11 months ago

7.2.0

1 year ago

8.1.0

1 year ago

8.0.0

1 year ago

8.2.0

1 year ago

7.0.3

1 year ago

7.0.0

1 year ago

6.0.0

1 year ago

5.3.0

1 year ago

5.2.4

1 year ago

5.2.3

1 year ago

5.1.0

1 year ago

5.0.0

1 year ago

4.0.1

1 year ago

4.0.0

1 year ago

3.0.7

1 year ago

3.0.5

1 year ago

3.0.4

2 years ago

3.0.3

2 years ago

3.0.2

2 years ago

3.0.0

2 years ago

2.2.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago