
Product
Announcing Socket Certified Patches: One-Click Fixes for Vulnerable Dependencies
A safer, faster way to eliminate vulnerabilities without updating dependencies
@hero-page/hero-ai-package-creator
Advanced tools
Create complete NPM packages quickly and easily with the power of AI. The hero-ai-package-creator generates all necessary files and configurations for your NPM package, saving you time and effort in the development process.
Hi! I'm Sam Chahine, and I'm pretty obsessed with pushing AI to its limits. It's like a tiny magic realm from whence I can extract wisdom from masters past... oh, it's just like a book. Anyway!
So to use this package, you'll need an API key for GPT4. I'm not sure when the waitlist format will end, and everyone will gain access. But till then, I'm happy to create any AI packages you recommend 😊
If you wanna chat, I'm on Twitter, LinkedIn, Hero (most of my work is on Hero)
Here are some packages I've created & published so far:
Each AI-created package takes anywhere between 10-20 minutes, depending on how many functions you want the package to have.
Here's a non-techy visual of which prompts were used to create this magical creator:
I've seen that sometimes, AI is over-confident in its ability to write proper regex, and ends up corrupting a file.
Worst case scenario is the script will catch this & stop (everything is tested at the end automatically), and you could either decided to fix the function yourself, or create another "simpler" package. Up to you!
npm install @hero-page/hero-ai-package-creator
It has 2 dependencies (which have their own dependencies):
They will probably be installed since they're in the package.json, just wanted to be transparent 😊
const {creator} = require("@hero-page/hero-ai-package-creator");
const config = {
"AUTHOR_NAME": "Sam Chahine",
"AUTHOR_URL": "https://github.com/kingmeers",
"AUTHOR_ORG_NAME": "Hero",
"AUTHOR_ORG_URL": "https://hero.page",
"GITHUB_USERNAME": "hero-page",
"GITHUB_OWNER_ID": "YOUR_GITHUB_OWNER_ID",
"REPO_VISIBILITY": "PUBLIC",
"REPO_PREFIX": "hero",
"SHOULD_PUBLISH_TO_NPM": false,
"GPT_MODEL": "gpt-4", // Can be any model for which you have access
"GPT_KEY": "GPT-KEY" // Must be a key that corresponds to above model's access
};
const ideas = [
{
prompt: "A set of functions for string manipulating emojis",
number_of_functions: 12,
name_prefix: "hero"
}
]
creator({
config,
ideas
});
You can customize the behavior of this package by providing a configuration object when initializing it. The available configuration options are described below, along with their default values:
{
"AUTHOR_NAME": "Sam Chahine",
"AUTHOR_URL": "https://github.com/kingmeers",
"AUTHOR_ORG_NAME": "Hero",
"AUTHOR_ORG_URL": "https://hero.page",
"GITHUB_USERNAME": "hero-page",
"GITHUB_OWNER_ID": "YOUR_GITHUB_OWNER_ID",
"REPO_VISIBILITY": "PUBLIC",
"REPO_PREFIX": "hero",
"SHOULD_PUBLISH_TO_NPM": false,
"GPT_MODEL": "gpt-4", // Can be any model for which you have access
"GPT_KEY": "GPT-KEY"
}
To obtain your GitHub owner ID, follow these steps:
gh CLI tool: brew install ghgh auth logingh api graphql -f query='{ organization(login:"YOUR_GITHUB_USERNAME/ORG") { id } }'The type of Schema this package currently creates & uses is quite simple, it looks like this:
{
"packages":[
{
"name":"hero-emoji-strings",
"description":"A library to manage strings with emojis, making it easier to manipulate, count and sanitize strings that contain emojis",
"functions":[
{
"function_name":"emojiCount",
"function_summary":"Counts the number of emojis in a given string. Handles Unicode and shortcodes emojis. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and long strings with emojis. Extreme cases: strings with special characters, strings with a mixture of letters, numbers, and emojis. Ignored cases: malformed shortcodes."
},
{
"function_name":"replaceEmoji",
"function_summary":"Replaces all occurrences of a specific emoji in a string with another string (could be another emoji). Test cases: strings with single emoji, multiple emojis, and mixed character types. Extreme cases: large strings and special characters. Ignored cases: invalid input emoji."
},
{
"function_name":"splitByEmoji",
"function_summary":"Splits a string into an array of strings divided by emojis. Test cases: single emojis, strings with no emojis, strings with mixed emojis, and strings with various delimiters. Extreme cases: strings with special characters and long strings with emojis. Ignored cases: malformed shortcodes."
},
]
}
]
}
It is generated with GPT4, and then fed back into GPT4 one by one, for further elaboration, function writing & tests too!
The purpose of this experiment is more research than anything. I have a visual output of the tests passed/failed, and some pass with flying colors, while others fail some.
What's interesting, is that GPT4 writes better tests than it does error-handling-functions!
If you want to see more schemas without having to run any GPT4, you can find several examples in the ./schemas folder.
I've also uploaded several packages under ./published_hero_modules incase you just want to browse!
Contributions and issues are welcome. However, please note that I may have limited time to fix issues and review contributions. Your help is appreciated!
This project is licensed under the MIT License.
FAQs
Create complete NPM packages quickly and easily with the power of AI. The hero-ai-package-creator generates all necessary files and configurations for your NPM package, saving you time and effort in the development process.
We found that @hero-page/hero-ai-package-creator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
A safer, faster way to eliminate vulnerabilities without updating dependencies

Product
Reachability analysis for Ruby is now in beta, helping teams identify which vulnerabilities are truly exploitable in their applications.

Research
/Security News
Malicious npm packages use Adspect cloaking and fake CAPTCHAs to fingerprint visitors and redirect victims to crypto-themed scam sites.