Socket
Socket
Sign inDemoInstall

@netlify/build-info

Package Overview
Dependencies
Maintainers
16
Versions
151
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netlify/build-info

Build info utility


Version published
Weekly downloads
104K
decreased by-0.39%
Maintainers
16
Weekly downloads
 
Created
Source

Build Node

Build Info

Build information detection utility.

The purpose of this lib is to, given a project and a configuration, return a set of useful data for our build system. Currently it's used to detect:

But it's possible to extend it in the future to extract other bits of information, such as the heuristics present in the build-image.

Example (Node.js)

const { getBuildInfo } = require('./src/main')

(async () => {
  console.log(await getBuildInfo({ projectDir: 'path/to/site', rootDir: '/project/root/dir' }))
  // {
  //   jsWorkspaces: {
  //     isRoot: false,
  //     packages: [
  //       'path/to/site',
  //       'path/to/component/library'
  //       'path/to/utility/library'
  //     ]
  //   },
  //   frameworks: [
  //     {
  //        name: 'gatsby',
  //        category: 'static_site_generator',
  //        dev: {
  //          commands: ['gatsby develop'],
  //          port: 8000
  //        },
  //        build: {
  //          commands: ['gatsby build'],
  //          directory: 'public'
  //        },
  //        env: { GATSBY_LOGGER: 'yurnalist' },
  //        plugins: []
  //      }
  //    ]
  // }

  console.log(await getBuildInfo({ projectDir: '/project/root/dir' }))
  // {
  //   jsWorkspaces: {
  //     isRoot: true,
  //     packages: [
  //       'path/to/site',
  //       'path/to/component/library'
  //       'path/to/utility/library'
  //     ]
  //   },
  //   frameworks: []
  // }
})();

Example (CLI)

$ build-info /project/root/dir
{
  jsWorkspaces: {
    isRoot: true,
    packages: [
      'path/to/site',
      'path/to/component/library'
      'path/to/utility/library'
    ]
  },
  frameworks: []
}

$ build-info path/to/site --rootDir /project/root/dir
{
  jsWorkspaces: {
    isRoot: false,
    packages: [
      'path/to/site',
      'path/to/component/library'
      'path/to/utility/library'
    ]
  },
  frameworks: [
    {
       name: 'gatsby',
       category: 'static_site_generator',
       dev: {
         commands: ['gatsby develop'],
         port: 8000
       },
       build: {
         commands: ['gatsby build'],
         directory: 'public'
       },
       env: { GATSBY_LOGGER: 'yurnalist' },
       plugins: []
     }
  ]
}

Contributors

Please see CONTRIBUTING.md for instructions on how to set up and work on this repository. Thanks for contributing!

FAQs

Package last updated on 09 May 2021

Did you know?

Socket

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.

Install

Related posts

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