Skip to main content
Deno 2 is finally here 🎉️
Learn more

Prompt_object

About

ask for all the properties of an object, and use the current value as the type and the default value

Usage

import prompt_object from 'https://deno.land/x/prompt_object/mod.ts'

const obj = {
  name: 'default name',
  age: 30,
  isMale: true,
  address: {
    city: 'default city',
    street: 'default street'
  },
  hobbies: ['code', 'music']

}

const result =  prompt_object(obj);

console.log(result);

//{
//   name: 'Garn',
//   age: 40,
//   isMale: true,
//   address: {
//     city: 'Valencia',
//     street: 'my street'
//   },
//   hobbies: ['fly', 'sleep', 'music', 'run']
// }