基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/ffsshhttiikk/opencode-agents-skills --skill javascript命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | javascript |
| description | JavaScript programming language for web development |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"developers","category":"programming-languages"} |
When building web applications or server-side code with Node.js.
// Let and const
const PI = 3.14159;
let count = 0;
// Template literals
const greeting = `Hello, ${name}!`;
// Destructuring
const { name, age } = user;
const [first, second] = array;
// Spread operator
const copy = { ...original, newProp: value };
const merged = [...arr1, ...arr2];
const numbers = [1, 2, 3, 4, 5];
// Map, Filter, Reduce
const doubled = numbers.map(n => n * 2);
const evens = numbers.filter(n => n % 2 === 0);
const sum = numbers.reduce((acc, n) => acc + n, 0);
// Find
const found = numbers.find(n => n > 3);
const index = numbers.findIndex(n => n === 3);
// Other methods
numbers.includes(3);
numbers.flatMap(x => [x, x * 2]);
const user = {
name: 'John',
age: 30,
greet() { return `Hi, I'm ${this.name}`; }
};
// Shorthand
const name = 'John';
const obj = { name };
// Optional chaining
const city = user?.address?.city;
// Nullish coalescing
const value = data ?? 'default';
// Promises
fetch('/api/data')
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
// Async/await
async function fetchData() {
try {
const res = await fetch('/api/data');
const data = await res.json();
return data;
} catch (err) {
console.error(err);
}
}
// Parallel
const [users, posts] = await Promise.all([
fetch('/api/users').then(r => r.json()),
fetch('/api/posts').then(r => r.json())
]);
// export.js
export const API_URL = 'https://api.example.com';
export function fetchData() { }
export default class MyClass { }
// import.js
import MyClass, { fetchData, API_URL } from './export.js';