Coder Social home page Coder Social logo

Comments (4)

mklement0 avatar mklement0 commented on June 18, 2024 1

Note that https://rannn505.gitbook.io/node-powershell/start again shows ps.dispose(), and only in the .catch() call, again inviting confusion.

If the intent is to show that the process remains open to service more commands later, at least a comment is called for.

from child-shell.

BenjaminMichael avatar BenjaminMichael commented on June 18, 2024

Makes sense for the readme example but starting out I actually found the opposite more confusing when working on anything nontrivial. Basically any time I have used node-powershell I have used the object for more than one PS command invocation and not disposing the object is much much faster than creating a new object every time. I don't find that I need to dispose of the object on errors either.

from child-shell.

mklement0 avatar mklement0 commented on June 18, 2024

@BenjaminMichael:

It is crucial that sample code work as-is, so as not to confuse beginners.

  • If there's a better - and concise - way to make sure the success case finishes processing, fix the sample to show that. (I can't tell, because the docs are broken, and I don't want to tinker with my browser's security settings just to make them work).

  • Otherwise, use the simple ps.Dispose() approach and add comments or notes pointing to more advanced information.

from child-shell.

rannn505 avatar rannn505 commented on June 18, 2024

removed the dispose from both as I want people to understand that the process is still open.

from child-shell.

Related Issues (20)

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.