diff --git a/LICENSE b/LICENSE index 26221cb042bdd1..2db83ba39778d8 100644 --- a/LICENSE +++ b/LICENSE @@ -2162,3 +2162,37 @@ The externally maintained libraries used by Node.js are: NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. """ + +- glob(7), located at src/node_path,cc, is licensed as follows: + """ + Valid-License-Identifier: MIT + SPDX-URL: https://spdx.org/licenses/MIT.html + Usage-Guide: + To use the MIT License put the following SPDX tag/value pair into a + comment according to the placement guidelines in the licensing rules + documentation: + SPDX-License-Identifier: MIT + License-Text: + + MIT License + + Copyright (c) + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + """ diff --git a/doc/api/path.md b/doc/api/path.md index d58fc044476bb9..a910e282f8874d 100644 --- a/doc/api/path.md +++ b/doc/api/path.md @@ -279,6 +279,29 @@ path.format({ // Returns: 'C:\\path\\dir\\file.txt' ``` +## `path.glob(pattern, path)` + + + +> Stability: 1 - Experimental + +* `pattern` {string} The glob pattern to match against. +* `path` {string} The path to test against the glob pattern. +* Returns: {boolean} + +The `path.glob()` method returns `true` if the `path` matches the glob +`pattern`, otherwise `false`. +Refer to the POSIX glob(7) documentation for more detail. + +```js +path.glob('*.js', 'foo.js'); +// Returns: true +path.glob('*.js', 'foo.json'); +// Returns: false +``` + ## `path.isAbsolute(path)`