Skip to content

Commit defdb64

Browse files
committed
deps: Add path-browserify package as local dependency
This module is independent from npm dependencies and live in `vendor` directory. As browser only support importing ES modules, I've changed a bit the module exports to use ESM instead. The `path-browserify` package matches with Node.js v10.3 API.
1 parent 553c808 commit defdb64

File tree

8 files changed

+682
-0
lines changed

8 files changed

+682
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: npm/path-browserify
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

vendor/path-browserify/.travis.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
language: node_js
2+
sudo: false
3+
node_js:
4+
- "10"
5+
- "9"
6+
- "8"
7+
- "6"
8+
- "4"
9+
- "iojs"
10+
- "0.12"
11+
- "0.10"
12+
- "0.8"
13+
before_install:
14+
# Old npm certs are untrusted https://github.com/npm/npm/issues/20191
15+
- 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ] || [ "${TRAVIS_NODE_VERSION}" = "0.8" ]; then export NPM_CONFIG_STRICT_SSL=false; fi'
16+
- 'nvm install-latest-npm'
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# path-browserify change log
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
This project adheres to [Semantic Versioning](http://semver.org/).
6+
7+
## 1.0.1
8+
* Fix a duplicate test name.
9+
* Tweak LICENSE text so Github can recognise it.
10+
* Tweak LICENSE text to include the year and author.
11+
* Add security policy file.
12+
13+
## 1.0.0
14+
This release updates to the Node v10.3.0 API. **This change is breaking**,
15+
because path methods now throw errors when called with arguments that are not
16+
strings.
17+
18+
* Add `path.parse` and `path.format`.
19+
* Add `path.posix` as an alias to `path`.
20+
* Port tests from Node.js.

vendor/path-browserify/LICENSE

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
MIT License
2+
3+
Copyright (c) 2013 James Halliday
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of
6+
this software and associated documentation files (the "Software"), to deal in
7+
the Software without restriction, including without limitation the rights to
8+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9+
the Software, and to permit persons to whom the Software is furnished to do so,
10+
subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

vendor/path-browserify/README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# path-browserify [![Build Status](https://travis-ci.org/browserify/path-browserify.png?branch=master)](https://travis-ci.org/browserify/path-browserify)
2+
3+
> The `path` module from Node.js for browsers
4+
5+
This implements the Node.js [`path`][path] module for environments that do not have it, like browsers.
6+
7+
> `path-browserify` currently matches the **Node.js 10.3** API.
8+
9+
## Install
10+
11+
You usually do not have to install `path-browserify` yourself! If your code runs in Node.js, `path` is built in. If your code runs in the browser, bundlers like [browserify](https://github.com/browserify/browserify) or [webpack](https://github.com/webpack/webpack) include the `path-browserify` module by default.
12+
13+
But if none of those apply, with npm do:
14+
15+
```
16+
npm install path-browserify
17+
```
18+
19+
## Usage
20+
21+
```javascript
22+
var path = require('path')
23+
24+
var filename = 'logo.png';
25+
var logo = path.join('./assets/img', filename);
26+
document.querySelector('#logo').src = logo;
27+
```
28+
29+
## API
30+
31+
See the [Node.js path docs][path]. `path-browserify` currently matches the Node.js 10.3 API.
32+
`path-browserify` only implements the POSIX functions, not the win32 ones.
33+
34+
## Contributing
35+
36+
PRs are very welcome! The main way to contribute to `path-browserify` is by porting features, bugfixes and tests from Node.js. Ideally, code contributions to this module are copy-pasted from Node.js and transpiled to ES5, rather than reimplemented from scratch. Matching the Node.js code as closely as possible makes maintenance simpler when new changes land in Node.js.
37+
This module intends to provide exactly the same API as Node.js, so features that are not available in the core `path` module will not be accepted. Feature requests should instead be directed at [nodejs/node](https://github.com/nodejs/node) and will be added to this module once they are implemented in Node.js.
38+
39+
If there is a difference in behaviour between Node.js's `path` module and this module, please open an issue!
40+
41+
## License
42+
43+
[MIT](./LICENSE)
44+
45+
[path]: https://nodejs.org/docs/v10.3.0/api/path.html

0 commit comments

Comments
 (0)