MCPcopy Create free account
hub / github.com/DavidWells/analytics / PLUGINSXX

Function PLUGINSXX

scripts/docs.js:78–101  ·  view source on GitHub ↗
(content, options)

Source from the content-addressed store, hash-verified

76 return `\`${sizeData.size}\``
77 },
78 PLUGINSXX(content, options) {
79 const base = path.resolve('packages')
80 const packages = fs.readdirSync(path.resolve('packages'))
81 .filter(pkg => !/^\./.test(pkg))
82 .filter(pkg => pkg !== 'analytics')
83 .map(pkg => ([pkg, JSON.parse(fs.readFileSync(path.join(base, pkg, 'package.json'), 'utf8'))]))
84 .filter(([pkg, json]) => {
85 return json.private !== true
86 })
87 // alphabetize list
88 .sort((a, b) => {
89 const one = a[1]
90 const two = b[1]
91 var textA = one.name.toLowerCase()
92 var textB = two.name.toLowerCase()
93 return (textA < textB) ? -1 : (textA > textB) ? 1 : 0
94 })
95 .map(([pkg, json]) => {
96 const { name, description } = json
97 return `- [${name}](https://github.com/DavidWells/analytics/tree/master/packages/${pkg}) ${description} [npm link](https://www.npmjs.com/package/${name}).`
98 }).concat('- Add yours! 👇')
99 .join('\n')
100 return packages
101 },
102 PLUGINS: function(content, options) {
103 const base = path.resolve('packages')
104 const packages = fs.readdirSync(path.resolve('packages'))

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected