npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@brut2com/myhome-common

v1.0.11

Published

Example :

Readme

myhome-common

For use Enums

Example :

import { Enum } from '@brut2com/myhome-common'

// or 

const { Enum } = require('@brut2com/myhome-common')

  const renderCategoryQuestion = () => {
    return (
      <SelectField
        label='Sélectionnez la catégorie de votre question'
        name='questionCategory'
        id='questionCategory'
        options={Enum.CategoryQuestionType()}
        variant='outlined'
        data-testid='question-form-category-select-test-id'
      />
    )
  }

Associate functions

In bdc-common npm package, we have associate function for use with enumerations.

// Require Utils part of bdc_common package
const { Utils } = require('@brutdecom/bdc_common')

// or

import { Utils } from '@brutdecom/bdc_common'

// Use utils function
const myConst = Utils.myUtilsFunction()
// return ...

Enum example for functions examples :

    const HabitatThemeQuestionType = [
        {
          value: 'theme-service-book',
          subTheme: [
              {
                value: 'sub-theme-service-book'
              }
          ]
        },
        {
            value: 'theme-framework',
            subTheme: [
                {
                  value: 'sub-theme-wood-state'
                },
                {
                  value: 'sub-theme-termites'
                }
            ]
          },
          {
            value: 'theme-roof',
            subTheme: [
                {
                  value: 'sub-theme-roof-tiles'
                },
                {
                  value: 'sub-theme-ridge-and-hip'
                }
            ]
          }
    ]

For use enum functions

Get values of the enum

const { Enum } = require('@brut2com/myhome-common')
const { Utils } = require('@brutdecom/bdc_common')

// or for REACT

import { Enum } from '@brut2com/myhome-common')
import { Utils } from '@brutdecom/bdc_common')


const enumValues = Utils.getEnumValues(Enum.HabitatThemeQuestionType()) // Look enum example Enum.HabitatThemeQuestionType() above for details
// enumValues = ['theme-service-book', 'theme-framework', 'theme-roof']

Get sub type values of the enum

const { Enum } = require('@brut2com/myhome-common')
const { Utils } = require('@brutdecom/bdc_common')

// or for REACT

import { Enum } from '@brut2com/myhome-common')
import { Utils } from '@brutdecom/bdc_common')


const enumSubTypeValues = Utils.getEnumSubTypeValues(Enum.HabitatThemeQuestionType(), 'subTheme') // Look enum example Enum.HabitatThemeQuestionType() above for details
// enumSubTypeValues = ['sub-theme-service-book', 'sub-theme-wood-state', 'sub-theme-termites', 'sub-theme-roof-tiles', 'sub-theme-ridge-and-hip']

Get sub type objects in enum

const { Enum } = require('@brut2com/myhome-common')
const { Utils } = require('@brutdecom/bdc_common')

// or for REACT

import { Enum } from '@brut2com/myhome-common')
import { Utils } from '@brutdecom/bdc_common')


const enumSubType = Utils.getEnumSubTypes(Enum.HabitatThemeQuestionType()) // Look enum example Enum.HabitatThemeQuestionType() above for details
// enumSubType = [
//   {
//     value: 'sub-theme-service-book'
//   },
//   {
//     value: 'sub-theme-wood-state'
//   },
//   {
//     value: 'sub-theme-termites'
//   },
//   {
//     value: 'sub-theme-roof-tiles'
//   },
//   {
//     value: 'sub-theme-ridge-and-hip'
//    }
//   ]

Get sub type objects in enum

const { Enum } = require('@brut2com/myhome-common')
const { Utils } = require('@brutdecom/bdc_common')

// or for REACT

import { Enum } from '@brut2com/myhome-common')
import { Utils } from '@brutdecom/bdc_common')


const subTypesValuesByParent = Utils.getEnumSubTypeValuesByParent(Enum.HabitatThemeQuestionType(), 'subTheme', 'theme-roof') // Look enum example Enum.HabitatThemeQuestionType() above for details
// subTypesValuesByParent = ['sub-theme-roof-tiles', 'sub-theme-ridge-and-hip']

Get sub type objects in enum

const { Enum } = require('@brut2com/myhome-common')
const { Utils } = require('@brutdecom/bdc_common')

// or for REACT

import { Enum } from '@brut2com/myhome-common')
import { Utils } from '@brutdecom/bdc_common')


const subTypesByParent = Utils.getEnumSubTypeByParent(Enum.HabitatThemeQuestionType(), 'subTheme', 'theme-roof') // Look enum example Enum.HabitatThemeQuestionType() above for details
// subTypesByParent = [
//     {
//       value: 'sub-theme-roof-tiles'
//     },
//     {
//       value: 'sub-theme-ridge-and-hip'
//     }
// ])

Enumerations

For look enums content.

const CategoryQuestionEnum = [
    {
      value: 'category-housing',
      text: 'Habitat'
    }
]

const CategoryQuestionType = () => {
  return CategoryQuestionEnum
}
const DiagnosticStatusEnum = [
    {
      value: 'diagnostic-status-validate'
    },
    {
      value: 'diagnostic-status-new'
    }
]

const DiagnosticStatusType = () => {
  return DiagnosticStatusEnum
}
const QuestionEnum = [
    {
      value: 'question-knowledge'
    },
    {
      value: 'question-inspection'
    },
    {
      value: 'question-historical'
    },
    {
      value: 'question-action'
    },
    {
      value: 'question-tax'
    },
    {
      value: 'question-aids'
    },
    {
      value: 'question-regulation'
    }
]

const QuestionType = () => {
  return QuestionEnum
}
const UserRoleEnum = [
    {
      value: 'admin'
    },
    {
      value: 'superAdmin'
    },
    {
      value: 'professional'
    },
    {
      value: 'client'
    }
]

const UserRoleType = () => {
  return UserRoleEnum
}
const HabitatThemeQuestionEnum = [
    {
      value: 'theme-service-book'
      subTheme: [
          {
            value: 'sub-theme-service-book'
          }
      ]
    },
    {
        value: 'theme-framework',
        subTheme: [
            {
              value: 'sub-theme-wood-state'
            },
            {
              value: 'sub-theme-sag'
            },
            {
              value: 'sub-theme-humidity'
            },
            {
              value: 'sub-theme-termites'
            }
        ]
      },
      {
        value: 'theme-roof',
        subTheme: [
            {
              value: 'sub-theme-roof-tiles'
            },
            {
              value: 'sub-theme-ridge-and-hip'
            },
            {
              value: 'sub-theme-chimney-stack'
            },
            {
              value: 'sub-theme-gutters'
            }
        ]
      },
      {
        value: 'theme-frontage',
        subTheme: [
            {
              value: 'sub-theme-crack'
            },
            {
              value: 'sub-theme-insulation'
            },
            {
              value: 'sub-theme-humidity'
            },
            {
              value: 'sub-theme-masonry'
            }
        ]
      },
      {
        value: 'theme-boiler',
        subTheme: [
            {
              value: 'sub-theme-control'
            }
        ]
      },
      {
        value: 'theme-electricity',
        subTheme: [
            {
              value: 'sub-theme-diagnostic'
            }
        ]
      },
      {
        value: 'theme-cellar-and-foundation',
        subTheme: [
            {
              value: 'sub-theme-humidity'
            },
            {
              value: 'sub-theme-mold'
            },
            {
              value: 'sub-theme-crack'
            }
        ]
      },
      {
        value: 'theme-chimney',
        subTheme: [
            {
              value: 'sub-theme-sweeping'
            }
        ]
      },
      {
        value: 'theme-carpentry-window',
        subTheme: [
            {
              value: 'sub-theme-sealing'
            },
            {
              value: 'sub-theme-aeration-grid'
            }
        ]
      },
      {
        value: 'theme-carpentry-water-consumption',
        subTheme: [
            {
              value: 'sub-theme-invoice'
            },
            {
              value: 'sub-theme-leaks'
            }
        ]
      },
      {
        value: 'theme-rge',
        subTheme: [
            {
              value: 'sub-theme-rge'
            }
        ]
      }
]

const HabitatThemeQuestionType = () => {
  return HabitatThemeQuestionEnum
}