-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
46656f6
commit 51e97d6
Showing
16 changed files
with
6,737 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Tests | ||
__test__/ | ||
*.spec.* | ||
*.test.* | ||
|
||
# Source files | ||
src/ | ||
build/ | ||
coverage/ | ||
|
||
# Build files | ||
.travis.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
language: node_js | ||
node_js: | ||
- "lts/*" | ||
install: | ||
- npm install | ||
dist: trusty | ||
sudo: false | ||
script: | ||
- npm run test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,23 @@ | ||
# exenv-es6 | ||
React's ExecutionEnvironment module extracted as ES6 | ||
React's ExecutionEnvironment module extracted as ES6 functions. Based on the ExecutionEnviroment module licensed under the MIT license by Facebook, Inc | ||
|
||
## Package exports | ||
`canUseDOM` - Checks if the DOM is available to access and use | ||
`canUseWorkers` - Checks if Web Workers are available for use | ||
`canUseEventListeners` - Checks if Event Listeners are available for use | ||
`canUseViewport` - Checks if there is a viewport available | ||
|
||
## Usage | ||
``` | ||
npm i exenv-es6 --save | ||
``` | ||
|
||
```js | ||
import { canUseDOM } from "exenv-es6"; | ||
|
||
if (canUseDOM()) { | ||
// do something that requires the dom | ||
} | ||
``` | ||
|
||
_Inspired by [exenv](https://github.com/JedWatson/exenv) from [JedWatson](https://github.com/JedWatson)_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* Utility for cleaning directories. | ||
* Usage: node build/clean.js %path% | ||
*/ | ||
const path = require("path"); | ||
const rimraf = require("rimraf"); | ||
const argv = require("yargs").argv; | ||
|
||
/** | ||
* All paths passed to the clean script | ||
*/ | ||
const paths = argv._; | ||
|
||
/** | ||
* Function to remove a given path | ||
*/ | ||
function cleanPath(cleanPath) { | ||
const removePath = path.resolve(process.cwd(), cleanPath); | ||
|
||
rimraf(removePath, () => { | ||
console.log(removePath, "cleaned"); | ||
}); | ||
} | ||
|
||
/** | ||
* Clean all paths | ||
*/ | ||
if (Array.isArray(paths)) { | ||
paths.forEach(cleanPath); | ||
} |
Oops, something went wrong.