Giter Site home page Giter Site logo

turkeys-cyber / netpad Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tareqimbasher/netpad

0.0 0.0 0.0 11.74 MB

A cross-platform C# editor and playground.

License: MIT License

Shell 0.17% JavaScript 0.44% C# 42.72% TypeScript 47.96% HTML 5.77% Dockerfile 0.03% SCSS 2.91%

netpad's Introduction

NetPad

A cross-platform C# editor and playground.

build CodeQL

Dark Light

Motivation

We love LINQPad, but we also miss its tremendous utility when not working on Windows. This is an effort to develop an open-source, web-enabled, cross-platform alternative.

The goal isn't to reach 100% feature parity with LINQPad, but to offer an acceptable alternative that covers the features developers most commonly need, and if we're lucky, a few new useful ones!

If you like the project, please star it ๐ŸŒŸ!

What does it do?

NetPad is a C# playground. It is the quickest way to run some C# code without the ceremonies of creating and managing projects. As soon as you open NetPad you'll be presented with the editor right away. Write some C# code, hit Run and see your output. That's it.

  • Prototyping and testing code before you incorporate it into your projects.
  • Experiment with C# features that you haven't used before. NetPad is a great way to start learning C#.
  • Query databases using LINQ or SQL.
  • Create and save your own utility or administration scripts.
  • Visualize Data in an interactive interface.

Requirements

The following must be be installed to use NetPad:

Additional requirements only if you plan to create and use database connections:

Download

Download the latest version for free!

For folks on Arch Linux or Manjaro, you can also install it from the AUR.

On macOS see this if you have trouble opening NetPad.

Updates

NetPad checks for updates on startup and will let you know when a new version is available. While it cannot yet install the latest update automatically, that feature will be introduced.

The latest version can be downloaded from the Releases page.

Contribution

Maintenance of this project is made possible by all the contributors and sponsors. A special thanks to all of you!

hamedwizย ย  lpreinerย ย  mattjcowanย ย 

If you like NetPad, please consider sponsoring it with a cup of coffee ($5) a month, every bit helps me maintain this project and deliver more features. Thank you โค๏ธ

Join our new Discord server to collaborate with the community.

Wiki

The Wiki is a great place to find more information about NetPad.

Troubleshooting

See the Troubleshooting section of the Wiki.

Features ๐Ÿš€

  • The basics:
    • Write, save and run your own scripts
    • Manage namespaces
    • Standard code editor features powered by Monaco editor
    • Auto-open unsaved scripts from previous session on launch
  • Dump complex objects to the results console
  • Export results to Excel or HTML
  • Choose the .NET SDK version you want to use per script
  • Add database connections and query them with LINQ
  • Run SQL queries
  • Add NuGet packages
  • Reference assemblies from disk
  • Monaco Editor & OmniSharp offer an editor experience similar to Visual Studio Code:
    • Code Completion (Intellisense)
    • Semantic Highlighting
    • CodeLens
    • Inlay Hints
    • Hover for Documentation
    • Go-to implementation
    • Find References
    • Find Symbol
    • Rename Symbol
    • Action Suggestions
    • Diagnostics
    • Document Highlighting
    • Contextual code folding
    • Format document/selection/on-type

Roadmap ๐Ÿšง

  • Debugging
  • Support for more database providers
  • Hyperlink driven Lazy-loading of results, and a DataGrid view
  • Benchmark your code
  • Referencing other scripts
  • View your code's Syntax Tree
  • View your code as IL
  • Export a script as a "ready to run" .NET app
  • Export a script as a C# project
  • Ability to run a script from the command-line
  • Git tracking of script changes
  • Quality of Life:
    • User-defined results styling
    • Workspaces/Sessions
  • Plugins & Theming

Tech Stack ๐Ÿ’ป

How it works: In a nutshell

NetPad runs an ASP.NET web app that hosts a web-based user interface. It can be packaged as an Electron desktop app or served and accessed on any browser.

Communication between the user interface and the ASP.NET backend occurs via HTTP and SignalR.

Build

This section describes how to build and run NetPad from source. NetPad can be run as an Electron desktop app or as a web application accessed with a web browser.

Requirements

  • Node v16+ (npm v8+)
  • .NET SDK 7.x
  • EF Core tools 5.x or later

NetPad as an Electron desktop app

1. Run the SPA

# Install dependencies
cd src/Apps/NetPad.Apps.App/ElectronHostHook
npm install

cd ../App
npm install

# Start the development web server
npm start

2. Run the .NET app

Install the Electron.NET CLI tool:

dotnet tool install ElectronNET.CLI -g

Start the app:

cd src/Apps/NetPad.Apps.App

# Start in watch mode (remove '/watch' to run without watch mode)
electronize start /watch /manifest electron.manifest.dev.js

# For macOS ARM, append the following to the 'electronize start' command
/target custom "osx-arm64;mac" /electron-arch arm64
Note

Only the very first electronize start is slow. Later runs are much faster.

NetPad as a Web app (accessed from a browser)

1. Run the SPA

# Install dependencies
cd Apps/NetPad.Apps.App/App
npm install

# Start the development web server
npm run start-web

2. Run the .NET app

cd Apps/NetPad.Apps.App
dotnet watch run --environment Development

and access the app via your web browser, ex: http://localhost:57930

Packaging ๐Ÿ“ฆ

The Electron app is built and packaged using electron-builder. Configuration is in the electron.manifest.js file.

Build the app for the desired platform from the root directory of the NetPad.Apps.App project:

# For x64:
electronize build /target win /manifest electron.manifest.js /PublishSingleFile false
electronize build /target osx /manifest electron.manifest.js /PublishSingleFile false
electronize build /target linux /manifest electron.manifest.js /PublishSingleFile false

# For macOS ARM:
electronize build /target custom "osx-arm64;mac" /electron-arch arm64 /manifest electron.manifest.js /PublishSingleFile false

Packaged files can be found in the bin/Desktop folder.

Notes
  1. To build flatpak files the flatpak and flatpak-builder packages need to be installed.
  2. On Linux, the /scripts/package-electron.sh script can be used to package the Electron app, in which case packaged files can be found in the /dist/ folder.

See the Electron.NET docs for additional CLI options when packaging the app, and electron-builder for additional configuration options.

Resources ๐Ÿ“š:

  • Docs: Go
  • More on SPA app startup and running tests: Go

netpad's People

Contributors

tareqimbasher avatar dependabot[bot] avatar jwallet avatar obaidaalhaasan avatar p-de-jong avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.