Skip to content

Commit

Permalink
Scaffold: Normalize repository
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Dec 17, 2018
1 parent 650cc1d commit 8aacbc1
Show file tree
Hide file tree
Showing 16 changed files with 434 additions and 363 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "gulp",
"globals": {
"Uint8Array": true
}
}
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text eol=lf
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,32 @@
# Logs
logs
*.log

# Runtime data
pids
*.pid
*.seed

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

# Dependency directory
# Commenting this out is preferred by some people, see
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git-
node_modules

# Users Environment Variables
.lock-wscript

# Garbage files
.DS_Store
*.flags.json
4 changes: 0 additions & 4 deletions .npmignore

This file was deleted.

1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ node_js:
- '10'
- '8'
- '6'
- '5'
- '4'
- '0.12'
- '0.10'
after_script:
- npm run coveralls
37 changes: 18 additions & 19 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
Copyright (c) 2014 Tyler Kellen
The MIT License (MIT)

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:
Copyright (c) 2014-2018 Tyler Kellen <tyler@sleekcode.net>, Blaine Bublitz <blaine.bublitz@gmail.com>, and Eric Schoffstall <yo@contra.io>

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
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 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.
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.
103 changes: 56 additions & 47 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,64 @@
# v8flags [![Build Status](https://secure.travis-ci.org/js-cli/js-v8flags.png)](http://travis-ci.org/js-cli/js-v8flags) [![Build status](https://ci.appveyor.com/api/projects/status/9psgmwayx9kpol1a?svg=true)](https://ci.appveyor.com/project/js-cli/js-v8flags)
> Get available v8 flags.
<p align="center">
<a href="http://gulpjs.com">
<img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
</a>
</p>

[![NPM](https://nodei.co/npm/v8flags.png)](https://nodei.co/npm/v8flags/)
# v8flags

## Example
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Travis Build Status][travis-image]][travis-url] [![AppVeyor Build Status][appveyor-image]][appveyor-url] [![Coveralls Status][coveralls-image]][coveralls-url] [![Gitter chat][gitter-image]][gitter-url]

Get available v8 flags.

## Usage
```js
const v8flags = require('v8flags');

v8flags(function (err, results) {
console.log(results); // [ '--use_strict',
// '--es5_readonly',
// '--es52_globals',
// '--harmony_typeof',
// '--harmony_scoping',
// '--harmony_modules',
// '--harmony_proxies',
// '--harmony_collections',
// '--harmony',
// ...
v8flags(function(err, results) {
console.log(results);
// [ '--use_strict',
// '--es5_readonly',
// '--es52_globals',
// '--harmony_typeof',
// '--harmony_scoping',
// '--harmony_modules',
// '--harmony_proxies',
// '--harmony_collections',
// '--harmony',
// ...
});
```

## Release History

* 2018-06-01 - v3.1.1 - Add version to the cache file name
* 2018-05-13 - v3.1.0 - Add support for node 10
* 2018-02-26 - v3.0.2 - fix typo in the failure message
* 2017-09-24 - v3.0.1 - fix home directory lookup behavior & fallback
* 2017-07-14 - v3.0.0 - store cached config to operating system specific directories
* 2017-04-18 - v2.1.1 - default to an empty user
* 2017-04-18 - v2.1.0 - hash username to support invalid path characters
* 2017-03-31 - v2.0.12 - don't pollute global namespace
* 2015-12-07 - v2.0.11 - cache to temp directory if home is present but unwritable
* 2015-07-28 - v2.0.10 - don't throw for electron runtime, just call back with empty array
* 2015-06-25 - v2.0.9 - call back with flags even if cache file can't be written
* 2015-06-15 - v2.0.7 - revert to 2.0.5 behavior.
* 2015-06-15 - v2.0.6 - store cache file in ~/.cache or ~/AppData/Local depending on platform
* 2015-04-18 - v2.0.5 - attempt to require config file, if this throws for any reason, fopen w+ and re-create
* 2015-04-16 - v2.0.4 - when concurrent processes are run and no config exists, don't append to the cached config.
* 2015-03-31 - v2.0.3 - prefer to store config files in user home over tmp
* 2015-01-18 - v2.0.2 - keep his dark tentacles contained
* 2015-01-15 - v2.0.1 - store temp file in `os.tmpdir()`, drop support for node 0.8
* 2015-01-15 - v2.0.0 - make the stupid thing async
* 2014-12-22 - v1.0.8 - exclude `--help` flag
* 2014-12-20 - v1.0.7 - pre-cache flags for every version of node from 0.8 to 0.11
* 2014-12-09 - v1.0.6 - revert to 1.0.0 behavior
* 2014-11-26 - v1.0.5 - get node executable from `process.execPath`
* 2014-11-18 - v1.0.4 - wrap node executable path in quotes
* 2014-11-17 - v1.0.3 - get node executable during npm install via `process.env.NODE`
* 2014-11-17 - v1.0.2 - get node executable from `process.env._`
* 2014-09-03 - v1.0.0 - first major version release
* 2014-09-02 - v0.3.0 - keep -- in flag names
* 2014-09-02 - v0.2.0 - cache flags
* 2014-05-09 - v0.1.0 - initial release
## API

### `v8flags(cb)`

Finds the available flags and calls the passed callback with any errors and an array of flag results.

### `v8flags.configfile`

The name of the cache file for flags.

### `v8flags.configPath`

The filepath location of the `configfile` above.

## License

MIT

[downloads-image]: http://img.shields.io/npm/dm/v8flags.svg
[npm-url]: https://www.npmjs.com/package/v8flags
[npm-image]: http://img.shields.io/npm/v/v8flags.svg

[travis-url]: https://travis-ci.org/gulpjs/v8flags
[travis-image]: http://img.shields.io/travis/gulpjs/v8flags.svg?label=travis-ci

[appveyor-url]: https://ci.appveyor.com/project/gulpjs/v8flags
[appveyor-image]: https://img.shields.io/appveyor/ci/gulpjs/v8flags.svg?label=appveyor

[coveralls-url]: https://coveralls.io/r/gulpjs/v8flags
[coveralls-image]: http://img.shields.io/coveralls/gulpjs/v8flags/master.svg

[gitter-url]: https://gitter.im/gulpjs/gulp
[gitter-image]: https://badges.gitter.im/gulpjs/gulp.svg
1 change: 0 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ environment:
- nodejs_version: "0.10"
- nodejs_version: "0.12"
- nodejs_version: "4"
- nodejs_version: "5"
- nodejs_version: "6"
- nodejs_version: "8"
- nodejs_version: "10"
Expand Down
24 changes: 12 additions & 12 deletions config-path.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
const os = require('os');
const path = require('path');
const userHome = require('homedir-polyfill')();
var os = require('os');
var path = require('path');
var userHome = require('homedir-polyfill')();

const env = process.env;
const name = 'js-v8flags';
var env = process.env;
var name = 'js-v8flags';

function macos () {
const library = path.join(userHome, 'Library');
function macos() {
var library = path.join(userHome, 'Library');
return path.join(library, 'Caches', name);
}

function windows () {
const appData = env.LOCALAPPDATA || path.join(userHome, 'AppData', 'Local');
function windows() {
var appData = env.LOCALAPPDATA || path.join(userHome, 'AppData', 'Local');
return path.join(appData, name);
}

// https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
function linux () {
const username = path.basename(userHome);
function linux() {
var username = path.basename(userHome);
return path.join(env.XDG_CACHE_HOME || path.join(userHome, '.cache'), name);
}

module.exports = function (platform) {
module.exports = function(platform) {
if (!userHome) {
return os.tmpdir();
}
Expand Down
Loading

0 comments on commit 8aacbc1

Please # to comment.