supports-preserve-symlinks-flag
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|
The npm package "supports-preserve-symlinks-flag" is designed to determine if the current Node.js version supports the --preserve-symlinks
flag. This is particularly useful in situations where you need to handle symbolic links in your JavaScript projects and want to ensure your Node.js version can support it.
The "supports-preserve-symlinks-flag" package is used by requiring and using it in your JavaScript code. Below is an example of how to use it:
var supportsPreserveSymlinks = require('node-supports-preserve-symlinks-flag');
var assert = require('assert');
assert.equal(supportsPreserveSymlinks, null); // in a browser
assert.equal(supportsPreserveSymlinks, false); // in node < v6.2
assert.equal(supportsPreserveSymlinks, true); // in node v6.2+
In the code snippet above, the require()
function is used to include the "supports-preserve-symlinks-flag" module. Its value is then checked using several assert.equal
calls for different conditions β null in a browser environment, false in Node.js versions below version 6.2, and true in Node.js version 6.2 or higher.
The documentation for the "supports-preserve-symlinks-flag" package can be found in the package's README on its GitHub repository. This README file provides a clear understanding of the package's purpose, how to use it, and how to run tests. It is the only official documentation for this package. Although the documentation might seem concise, the package itself has a pretty straightforward purpose and usage, making the README file sufficient.