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

Function PACKAGES

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

Source from the content-addressed store, hash-verified

33 transforms: {
34 // https://github.com/moleculerjs/moleculer-addons/blob/master/readme-generator.js#L11
35 PACKAGES(content, options) {
36 const base = path.resolve('packages')
37 const packages = fs.readdirSync(path.resolve('packages'))
38 .filter(pkg => !/^\./.test(pkg))
39 .map(pkg => ([pkg, fs.readFileSync(path.join(base, pkg, 'package.json'), 'utf8')]))
40 .filter(([pkg, json]) => {
41 const parsed = JSON.parse(json)
42 return parsed.private !== true
43 })
44 .map(([pkg, json]) => {
45 const { name, description } = JSON.parse(json)
46 return `- [${name}](./packages/${pkg}) ${description} [npm link](https://www.npmjs.com/package/${name}).`
47 })
48 .join('\n')
49 return packages
50 },
51 pkgSize: async (content, options, context) => {
52 const dir = path.dirname(context.originalPath)
53 let fileToCheck

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected