2.0.16 • Published 2 years ago

@geut/brode v2.0.16

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

brode

A polyfill Node.js browser platform

Test Status JavaScript Style Guide standard-readme compliant

Made by GEUT

Install

$ npm install -g @geut/brode

Usage

$ brode index.js

Test using uvu

brode provides built-in support for uvu and tap like test runners.

// test.js
import { test } from 'uvu';
import * as assert from 'uvu/assert';

test('Math.sqrt()', () => {
  assert.is(Math.sqrt(4), 2);
  assert.is(Math.sqrt(144), 12);
  assert.is(Math.sqrt(2), Math.SQRT2);
});

test('JSON', () => {
  const input = {
    foo: 'hello',
    bar: 'world'
  };

  const output = JSON.stringify(input);

  assert.snapshot(output, `{"foo":"hello","bar":"world"}`);
  assert.equal(JSON.parse(output), input, 'matches original');
});

test.run();
$ brode test.js -p uvu --target chromium,firefox
• •   (2 / 2)

  Total:     2
  Passed:    2
  Skipped:   0
  Duration:  3.00ms
  Target:    chromium

• •   (2 / 2)

  Total:     2
  Passed:    2
  Skipped:   0
  Duration:  6.00ms
  Target:    firefox

Node.js Stream support

You can use Node.js streams in the browser:

// reader.js
process.stdin.on('data', data => {
  console.log(data.toString())
})
$ echo 'hello' | brode reader.js
hello

Issues

:bug: If you found an issue we encourage you to report it on github. Please specify your OS and the actions to reproduce it.

Contributing

:busts_in_silhouette: Ideas and contributions to the project are welcome. You must follow this guideline.

License

MIT © A GEUT project

2.0.15

2 years ago

2.0.16

2 years ago

2.0.14

2 years ago

2.0.13

2 years ago

2.0.11

2 years ago

2.0.7

2 years ago

2.0.12

2 years ago

2.0.6

2 years ago

2.0.9

2 years ago

2.0.10

2 years ago

2.0.8

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.4

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.3

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.14

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

3 years ago

1.0.0

3 years ago