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

fasttext-js

Package Overview
Dependencies
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fasttext-js - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

lib/getFastTextPath.js

6

lib/predictAsync.js

@@ -9,2 +9,6 @@ 'use strict';

var _getFastTextPath = require('./getFastTextPath');
var _getFastTextPath2 = _interopRequireDefault(_getFastTextPath);
var _normalize = require('./normalize');

@@ -20,3 +24,3 @@

return new Promise(function (resolve, reject) {
var child = (0, _child_process.spawn)('./fastText/fasttext', ['predict-prob', modelPath, '-']);
var child = (0, _child_process.spawn)((0, _getFastTextPath2.default)(), ['predict-prob', modelPath, '-']);

@@ -23,0 +27,0 @@ var stdout = '';

@@ -9,2 +9,8 @@ 'use strict';

var _getFastTextPath = require('./getFastTextPath');
var _getFastTextPath2 = _interopRequireDefault(_getFastTextPath);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// inputTxt: string (filePath)

@@ -17,3 +23,3 @@ // outputModel: string (filePath)

(0, _child_process.execFile)('./fastText/fasttext', ['supervised', '-input', dataPath, '-output', output], function (err) {
(0, _child_process.execFile)((0, _getFastTextPath2.default)(), ['supervised', '-input', dataPath, '-output', output], function (err) {
if (err) {

@@ -20,0 +26,0 @@ if (err) {

2

package.json
{
"name": "fasttext-js",
"version": "1.0.0",
"version": "1.0.1",
"description": "Node.js interface for fastText",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

import { spawn } from 'child_process';
import getFastTextPath from './getFastTextPath';
import normalize from './normalize';

@@ -9,3 +10,3 @@

new Promise((resolve, reject) => {
const child = spawn('./fastText/fasttext', ['predict-prob', modelPath, '-']);
const child = spawn(getFastTextPath(), ['predict-prob', modelPath, '-']);

@@ -12,0 +13,0 @@ let stdout = '';

import { execFile } from 'child_process';
import getFastTextPath from './getFastTextPath';
// inputTxt: string (filePath)

@@ -10,3 +12,3 @@ // outputModel: string (filePath)

execFile('./fastText/fasttext', ['supervised', '-input', dataPath, '-output', output], (err) => {
execFile(getFastTextPath(), ['supervised', '-input', dataPath, '-output', output], (err) => {
if (err) {

@@ -13,0 +15,0 @@ if (err) {

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