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

node-csproj-util

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-csproj-util

Edit Visual Studio project files using Node.js

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

node-csproj-util

Edit Visual Studio project files using Node.js

This library allows you to add files to be included in a .csproj and .sln file. For example, any templates created by Node.js code generators can be included in compilation of the Visual Studio solution.

Installation

    npm install node-csproj-util

Usage

Reading from a .sln file

    var { Solution } = require('node-csproj-util');
    
    (async function() {
        const sln = new Solution('examples/TestSolution/TestSolution.sln');
        await sln.read();
        console.log(sln.projects);
        ...
    })();

Reading from a .proj file

Project in a solution:

        ...
        const proj = sln.projects[0];
        await proj.read();
        ...

Directly loading a project:

        ...
        const proj = new Project({ filePath: 'examples/TestSolution/TestProject/TestProject.csproj' });
        await proj.read();
        ...

Adding files to project

        ...
        // included in compilation
        proj.add('content/testClass.cs');
        // added as content
        proj.add('content/testImage.png');
        await proj.save();
        ...

Adding to solution folders

        ...
        // you can create or use an existing one
        const folder = sln.addFolder('MyFolder');
        sln.addToFolder(folder, proj);
        await sln.save();
        ...

You can create or use an existing one, since they are not actual folders, get them using the Solution.projects property.

Keywords

FAQs

Package last updated on 17 Sep 2020

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