Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

netlify

Package Overview
Dependencies
Maintainers
20
Versions
175
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

netlify

Netlify Node.js API client

  • 13.1.21
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
136K
decreased by-16.08%
Maintainers
20
Weekly downloads
 
Created

What is netlify?

The netlify npm package provides a command-line interface (CLI) for interacting with Netlify's platform. It allows developers to deploy sites, manage DNS settings, configure build settings, and more, directly from the terminal.

What are netlify's main functionalities?

Deploy a site

This feature allows you to deploy a site to Netlify. You need to provide your access token, site ID, and the directory path of your site.

const netlify = require('netlify');

async function deploySite() {
  const client = new netlify.NetlifyAPI('YOUR_ACCESS_TOKEN');
  const site = await client.deploy({
    siteId: 'YOUR_SITE_ID',
    dir: 'path/to/your/site'
  });
  console.log('Site deployed:', site);
}
deploySite();

Create a new site

This feature allows you to create a new site on Netlify. You need to provide your access token and the desired name for the new site.

const netlify = require('netlify');

async function createSite() {
  const client = new netlify.NetlifyAPI('YOUR_ACCESS_TOKEN');
  const site = await client.createSite({
    body: {
      name: 'my-new-site'
    }
  });
  console.log('New site created:', site);
}
createSite();

List all sites

This feature allows you to list all the sites associated with your Netlify account. You need to provide your access token.

const netlify = require('netlify');

async function listSites() {
  const client = new netlify.NetlifyAPI('YOUR_ACCESS_TOKEN');
  const sites = await client.listSites();
  console.log('All sites:', sites);
}
listSites();

Other packages similar to netlify

Keywords

FAQs

Package last updated on 21 Aug 2024

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