Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bsb-js

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bsb-js - npm Package Compare versions

Comparing version 1.0.2 to 1.1.0

43

index.js
// @flow
const os = require('os')
const { exec, execSync } = require('child_process')
const { readFile, readFileSync } = require('fs')
const {exec, execSync} = require('child_process')
const {readFile, readFileSync} = require('fs')
const utils = require('./utils')

@@ -29,8 +29,6 @@ /*:: import type { BsModuleFormat } from 'read-bsconfig' */

/**
* Runs `bsb` async
*/
/** Runs `bsb` async */
function runBuild(cwd /*: string */) /*: Promise<string> */ {
return new Promise((resolve, reject) => {
exec(bsb, { maxBuffer: Infinity, cwd }, (err, stdout, stderr) => {
exec(bsb, {maxBuffer: Infinity, cwd}, (err, stdout, stderr) => {
const output = `${stdout.toString()}\n${stderr.toString()}`

@@ -46,7 +44,5 @@ if (err) {

/**
* Runs `bsb`
*/
function runBuildSync() {
const output = execSync(bsb, { stdio: 'pipe' })
/** Runs `bsb` */
function runBuildSync(cwd /*: string */) /*: string */ {
const output = execSync(bsb, {stdio: 'pipe', cwd})

@@ -66,5 +62,3 @@ return output.toString()

/**
* Compiles a Reason file to JS
*/
/** Compiles a Reason file to JS */
function compileFile(

@@ -74,3 +68,3 @@ buildDir /*: string */,

path /*: string */,
id /*: ?string */ = null
id /*: ?string */ = null,
) /*: Promise<Compilation> */ {

@@ -92,3 +86,3 @@ if (id && buildRuns[id] !== undefined) {

warnings: [],
errors: [err]
errors: [err],
})

@@ -101,7 +95,7 @@ } else {

warnings: utils.processBsbWarnings(output),
errors: []
errors: [],
})
}
})
})
}),
)

@@ -111,15 +105,14 @@ .catch(err => ({

warnings: [],
errors: utils.processBsbError(err)
errors: utils.processBsbError(err),
}))
}
/**
* Compiles a Reason file to JS sync
*/
/** Compiles a Reason file to JS sync */
function compileFileSync(
buildDir /*: string */,
moduleType /*: BsModuleFormat | 'js' */,
path /*: string */
path /*: string */,
) /*: string */ {
try {
runBuildSync()
runBuildSync(buildDir)
} catch (e) {

@@ -138,3 +131,3 @@ throw utils.processBsbError(e.output.toString())

compileFile,
compileFileSync
compileFileSync,
}
{
"name": "bsb-js",
"version": "1.0.2",
"version": "1.1.0",
"description": "JS library wrapping BuckleScript build",

@@ -13,8 +13,3 @@ "main": "index.js",

},
"keywords": [
"bsb",
"bucklescript",
"reason",
"reasonml"
],
"keywords": ["bsb", "bucklescript", "reason", "reasonml"],
"author": "Ryan Delaney <rrdelaney@outlook.com>",

@@ -21,0 +16,0 @@ "license": "MIT",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc