Skip to content

Commit

Permalink
add linter and formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
juliangruber committed Mar 29, 2022
1 parent 382b427 commit 9b614f5
Show file tree
Hide file tree
Showing 5 changed files with 743 additions and 664 deletions.
7 changes: 3 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

# builtins

List of node.js [builtin modules](http://nodejs.org/api/).
List of node.js [builtin modules](http://nodejs.org/api/).

[![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins) [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/builtins.svg)](https://greenkeeper.io/)
[![build status](https://secure.travis-ci.org/juliangruber/builtins.svg)](http://travis-ci.org/juliangruber/builtins) [![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/builtins.svg)](https://greenkeeper.io/)

## Example

Expand Down Expand Up @@ -33,4 +32,4 @@ assert(builtins.indexOf('wasi') > -1)

## License

MIT
MIT
33 changes: 18 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,36 +42,39 @@ module.exports = function ({
]

var versionLockedModules = {
'freelist': '<6.0.0',
'v8': '>=1.0.0',
'process': '>=1.1.0',
'inspector': '>=8.0.0',
'async_hooks': '>=8.1.0',
'http2': '>=8.4.0',
'perf_hooks': '>=8.5.0',
'trace_events': '>=10.0.0',
'worker_threads': '>=12.0.0',
freelist: '<6.0.0',
v8: '>=1.0.0',
process: '>=1.1.0',
inspector: '>=8.0.0',
async_hooks: '>=8.1.0',
http2: '>=8.4.0',
perf_hooks: '>=8.5.0',
trace_events: '>=10.0.0',
worker_threads: '>=12.0.0'
}

Object.entries(versionLockedModules).forEach(([name, v]) => {
if (version =='*' || semver.satisfies(version, v)) {
if (version === '*' || semver.satisfies(version, v)) {
coreModules.push(name)
}
})

var experimentalModules = {
'worker_threads': '>=10.5.0',
'wasi': '>=12.16.0',
'diagnostics_channel': '^14.17.0 || >=15.1.0',
worker_threads: '>=10.5.0',
wasi: '>=12.16.0',
diagnostics_channel: '^14.17.0 || >=15.1.0'
}

if (experimental) {
Object.entries(experimentalModules).forEach(([name, v]) => {
if (!coreModules.includes(name) && (version == '*' || semver.satisfies(version, v))) {
if (
!coreModules.includes(name) &&
(version === '*' || semver.satisfies(version, v))
) {
coreModules.push(name)
}
})
}

return coreModules
}
Loading

0 comments on commit 9b614f5

Please sign in to comment.