We study the stability of invariant sets such as equilibria or periodic orbits of a Dynamical System given by a general autonomous nonlinear ordinary differential equation (ODE). A classical tool to analyse the stability are Lyapunov functions, i.e. scalar-valued functions, which decrease along solutions of the ODE. An alternative to Lyapunov functions is contraction analysis. Here, stability (or incremental stability) is a consequence of the contraction property between two adjacent solutions, formulated as the local property of a Finsler-Lyapunov function. This has the advantage that the invariant set plays no special role and does not need to be known a priori. In this paper, we propose a method to numerically construct a Finsler-Lyapunov function by solving a first-order partial differential equation using meshless collocation. Depending on the expected attractor, the contraction only takes place in certain directions, which can easily be implemented within the method. In the basin of attraction of an exponentially stable equilibrium or periodic orbit, we show that the PDE problem has a solution, which provides error estimates for the numerical method. Furthermore, we show how the method can also be applied outside the basin of attraction and can detect the stability as well as the stable/unstable directions of equilibria. The method is illustrated with several examples.