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

new-words

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

new-words - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

49

index.js

@@ -1,16 +0,55 @@

// German Chinese Spanish Italian
// de,zh,es,it
// German Chinese Spanish Italian English
// de,zh,es,it,en
//https://random-word-api.herokuapp.com/word?number=10&swear=0&lang=en
module.exports.Generate = async function(AmountOfWords, ExplicitWords, Language) {
module.exports.Generate = async function(AmountOfWords, ExplicitWords, Language) {
const axios = require('axios')
const SupportedLanuages = [
"de",
"zh",
"es",
"it",
"en"
]
var ExplicitNumber = 0
if (AmountOfWords) {
if (!isNaN(AmountOfWords)) {
console.log("number")
if (ExplicitWords) {
if (ExplicitWords === true) {
ExplicitNumber = 1
} else if (ExplicitWords === false) {
ExplicitNumber = 0
} else {
ExplicitNumber = 0
}
} else {
ExplicitNumber = 0
}
if (Language) {
if (SupportedLanuages.includes(Language)) {
Language = Language
} else {
console.log("ERROR: Entered language is not supported yet.\n\nFIX: Try using any of these languages: de , zh , es , it , en\n\nLanguage defaulted to en (English)")
Language = 'en'
}
} else {
Language = 'en'
}
var result;
await axios
.get('https://random-word-api.herokuapp.com/word?number=' + AmountOfWords.toString() + '&swear=' + ExplicitNumber.toString() + '&lang=' + Language)
.then((response) => {
result = response
})
return result;
} else {
console.log('not a number')
console.log("ERROR: Parameter #1 of the .Generate() function is not a valid Number.\n\nFIX: Enter the amount of words that you want to generate in the 1st parameter of the .Generate() function\n\n Amount of Words Defaulted to 1")
}
}
}

23

package.json
{
"name": "new-words",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "robertcodez",
"license": "ISC"
}
"name": "new-words",
"version": "1.0.1",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "robertcodez",
"license": "ISC",
"dependencies": {
"axios": "^0.26.1"
}
}
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