New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@collectionscms/plugin-text-generator

Package Overview
Dependencies
Maintainers
0
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@collectionscms/plugin-text-generator - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

24

bin.js

@@ -5,9 +5,26 @@ #!/usr/bin/env node

import { TextGenerator } from "./generations/textGenerator.js";
import { Translator } from "./translations/translator.js";
const program = new Command();
const runSummarize = async (options) => {
const value = options.value.trim();
const generator = new TextGenerator(process.env.OPENAI_API_KEY ?? "", "gpt-4o-mini");
const apiKey = process.env.OPENAI_API_KEY;
if (!apiKey) {
console.error("❌ Error: OPENAI_API_KEY is not set");
return;
}
const generator = new TextGenerator(apiKey, "gpt-4o-mini");
const result = await generator.summarizeSeo(value, "English");
console.log(`✨ Success`, result);
};
const runTranslate = async (options) => {
const value = options.value.trim();
const apiKey = process.env.TRANSLATOR_API_KEY;
if (!apiKey) {
console.error("❌ Error: TRANSLATOR_API_KEY is not set");
return;
}
const translator = new Translator(apiKey);
const result = await translator.translate([value], "ja", "en-US");
console.log(`✨ Success`, result);
};
program

@@ -18,2 +35,7 @@ .command("text:summarize")

.action(runSummarize);
program
.command("text:translate")
.description("translate documents")
.requiredOption("-v, --value <value>", "value option")
.action(runTranslate);
program.parseAsync(process.argv);

3

package.json
{
"name": "@collectionscms/plugin-text-generator",
"version": "1.0.2",
"version": "1.0.3",
"description": "Text Generation Plugin for Collections.",

@@ -9,2 +9,3 @@ "type": "module",

"text:summarize": "node --loader ts-node/esm ./src/bin.ts text:summarize",
"text:translate": "node --loader ts-node/esm ./src/bin.ts text:translate",
"lint": "eslint 'src/**/*.ts' --ignore-path .gitignore",

@@ -11,0 +12,0 @@ "lint:fix": "npm run lint -- --fix",

@@ -9,2 +9,3 @@ import * as deepl from "deepl-node";

preserveFormatting: true,
tagHandling: "html",
});

@@ -11,0 +12,0 @@ return textResults.map((textResult) => ({

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