Skip to content

Instantly share code, notes, and snippets.

@idkjs
Last active July 6, 2021 19:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save idkjs/b373fd3a206d2e6edc90d98e6c714114 to your computer and use it in GitHub Desktop.
Save idkjs/b373fd3a206d2e6edc90d98e6c714114 to your computer and use it in GitHub Desktop.
node-glob reasonml web

reason-glob

BuckleScript bindings to node-glob.

Status: Very basic, but functional

Example

Glob.glob("**/*.js", (_, files) => Array.iter(Js.log, files));

Installation

npm install reason-glob@gist:b373fd3a206d2e6edc90d98e6c714114

Then add reason-glob to bs-dependencies in your bsconfig.json:

{
  ...
  "bs-dependencies": ["reason-glob"]
}
{
"name": "reason-glob",
"bsc-flags": ["-bs-super-errors"],
"sources": ["."],
"namespace":false
}
type error;
[@bs.module]
external glob: (string, (Js.nullable(error), array(string)) => unit) => unit =
"glob";
[@bs.val] [@bs.module "glob"] external sync: string => array(string) = "sync";
{
"name": "reason-glob",
"version": "0.1.1",
"description": "BuckleScript bindings to node-glob. Match files using the patterns the shell uses, like stars and stuff.",
"scripts": {
"build": "bsb -make-world",
"start": "bsb -make-world -w",
"clean": "bsb -clean-world",
"test": "exit 0"
},
"homepage": "https://github.com/reasonml-community/bs-glob#readme",
"bugs": "https://github.com/reasonml-community/bs-glob/issues",
"repository": {
"type": "git",
"url": "git+https://github.com/reasonml-community/bs-glob.git"
},
"author": "glennsl",
"keywords": [
"bucklescript",
"glob"
],
"license": "MIT",
"devDependencies": {
"bs-platform": "^9.0.2"
},
"dependencies": {
"glob": "^7.1.7"
}
}
# reason-glob
BuckleScript bindings to [node-glob](https://github.com/isaacs/node-glob).
Status: Very basic, but functional
## Example
```reason
Glob.glob("**/*.js", (_, files) => Array.iter(Js.log, files));
```
## Installation
```sh
npm install reason-glob@gist:b373fd3a206d2e6edc90d98e6c714114
```
Then add `reason-glob` to `bs-dependencies` in your `bsconfig.json`:
```js
{
...
"bs-dependencies": ["reason-glob"]
}
```
@idkjs
Copy link
Author

idkjs commented Jul 6, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment